In rails 4.2 respond_with has been moved out of core into the responders gem.
Beta release notes.
respond_with has moved out and into its own proper ho
Rationale from David Heinemeier Hansson (creator of Ruby on Rails):
I'd like to take this opportunity to split respond_with/class-level respond_to into an external plugin. I'm generally not a fan of the code that comes out of using this pattern. It encourages model#to_json and it hides the difference between HTML and API responses in ways that convolute the code.
So how about we split this into a gem for 4.2, with the current behavior, but also with an option to get the new behavior as suggested here through a configuration point.
Full discussion at this link:
https://github.com/rails/rails/pull/12136#issuecomment-50216483