method
respond_with
rails latest stable - Class:
ActionController::MimeResponds
respond_with(*)public
No documentation available.
# File actionpack/lib/action_controller/metal/mime_responds.rb, line 17
def respond_with(*)
raise NoMethodError, "The `respond_with' 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 2Notes
needs to be paired with respond_to
Needs to be paired with respond_to at the top of your class.
class MyController < ApplicationController
respond_to :js, :html
Undocumented :location option
You can use undocumented +:location+ option to override where +respond_to+ sends if resource is valid, e.g. to redirect to products index page instead of a specific product's page, use:
respond_with(@product, :location => products_url)