Created
May 23, 2012 11:46
-
-
Save paneq/2774761 to your computer and use it in GitHub Desktop.
Alternative respond formats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
respond_to(:json, :html) do |json, html| | |
json { render :json => UserSessionPresenter.new(current_user) } | |
html { redirect_back_or_default root_path } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
format do |json, html| | |
json { render :json => UserSessionPresenter.new(current_user) } | |
html { redirect_back_or_default root_path } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
format do | |
json { render :json => UserSessionPresenter.new(current_user) } | |
html { redirect_back_or_default root_path } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
json { render :json => UserSessionPresenter.new(current_user) } | |
html { redirect_back_or_default root_path } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
respond_to do |format| | |
format.json { render :json => UserSessionPresenter.new(current_user) } | |
format.html { redirect_back_or_default root_path } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment