method

respond_with

rails latest stable - Class: ActionController::MimeResponds

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.2.1) is shown here.

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

ssoroka · Oct 16, 201012 thanks

Needs to be paired with respond_to at the top of your class.

class MyController < ApplicationController
respond_to :js, :html

Undocumented :location option

szeryf · Oct 8, 20116 thanks

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)