method
respond_to
rails latest stable - Class:
ActionController::MimeResponds::ClassMethods
respond_to(*)public
No documentation available.
# File actionpack/lib/action_controller/metal/mime_responds.rb, line 8
def respond_to(*)
raise NoMethodError, "The controller-level `respond_to' feature has " "been extracted to the `responders` gem. Add it to your Gemfile to " "continue using this feature:\n" " gem 'responders', '~> 2.0'\n" "Consult the Rails upgrade guide for details."
end 1Note
Also useful without respond_with
Using the class method #respond_to allows controller-level specification of the allowed mime-types. Without #respond_with , it enables a
Completed 406 Not Acceptable
response rather than
ActionView::MissingTemplate
error when an unsupported type is requested.
See: http://www.justinweiss.com/blog/2014/11/03/respond-to-without-all-the-pain/