method
respond_with
v4.2.1 -
Show latest stable
-
4 notes -
Class: ActionController::MimeResponds
- 1.0.0
- 1.1.6
- 1.2.6
- 2.0.3
- 2.1.0
- 2.2.1
- 2.3.8
- 3.0.0 (0)
- 3.0.9 (0)
- 3.1.0 (1)
- 3.2.1 (0)
- 3.2.8 (0)
- 3.2.13 (0)
- 4.0.2 (30)
- 4.1.8 (0)
- 4.2.1 (-38)
- 4.2.7
- 4.2.9
- 5.0.0.1
- 5.1.7
- 5.2.3
- 6.0.0
- 6.1.3.1
- 6.1.7.7
- 7.0.0
- 7.1.3.2
- 7.1.3.4
- What's this?
Register or
log in
to add new notes.
ssoroka -
October 16, 2010 - (>= v3.0.0)
12 thanks
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
szeryf -
October 8, 2011
6 thanks
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)
dougireton -
June 24, 2011 - (v3.0.0 - v3.0.9)
1 thank
RailsCast about Responders
See Ryan Bate’s excellent RailsCast #224 about Responders in Rails 3.x: http://asciicasts.com/episodes/224-controllers-in-rails-3
newdark -
June 1, 2014 - (v4.0.2)
1 thank
Alternitive to to add flash to respond with
This is a nice way to add flash if you don’t have a any logic that needs to go around your flash.
def destroy @current_user_session.destroy respond_with @current_user_session do |format| format.html {redirect_to login_path, notice: "You have been logged out"} end end