diff options
author | AvnerCohen <israbirding@gmail.com> | 2012-10-27 22:05:27 +0200 |
---|---|---|
committer | AvnerCohen <israbirding@gmail.com> | 2012-10-27 22:05:27 +0200 |
commit | 62f273b6501db72e3c902d947e6828dcab9c004a (patch) | |
tree | 6e49d8b5219a94844b19c3809ae64783fef16f6a /actionpack/lib/action_controller/metal/redirecting.rb | |
parent | cc81af2fe438fd3e2c8f95dae8f757de0bab1b53 (diff) | |
download | rails-62f273b6501db72e3c902d947e6828dcab9c004a.tar.gz rails-62f273b6501db72e3c902d947e6828dcab9c004a.tar.bz2 rails-62f273b6501db72e3c902d947e6828dcab9c004a.zip |
Multiple changes to 1,9 hash syntax
Diffstat (limited to 'actionpack/lib/action_controller/metal/redirecting.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/redirecting.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller/metal/redirecting.rb b/actionpack/lib/action_controller/metal/redirecting.rb index ee0e69d87c..b23938e7d9 100644 --- a/actionpack/lib/action_controller/metal/redirecting.rb +++ b/actionpack/lib/action_controller/metal/redirecting.rb @@ -24,7 +24,7 @@ module ActionController # * <tt>:back</tt> - Back to the page that issued the request. Useful for forms that are triggered from multiple places. # Short-hand for <tt>redirect_to(request.env["HTTP_REFERER"])</tt> # - # redirect_to :action => "show", :id => 5 + # redirect_to action: "show", id: 5 # redirect_to post # redirect_to "http://www.rubyonrails.org" # redirect_to "/images/screenshot.jpg" @@ -34,10 +34,10 @@ module ActionController # # The redirection happens as a "302 Moved" header unless otherwise specified. # - # redirect_to post_url(@post), :status => :found - # redirect_to :action=>'atom', :status => :moved_permanently - # redirect_to post_url(@post), :status => 301 - # redirect_to :action=>'atom', :status => 302 + # redirect_to post_url(@post), status: :found + # redirect_to action: 'atom', status: :moved_permanently + # redirect_to post_url(@post), status: 301 + # redirect_to action: 'atom', status: 302 # # The status code can either be a standard {HTTP Status code}[http://www.iana.org/assignments/http-status-codes] as an # integer, or a symbol representing the downcased, underscored and symbolized description. @@ -49,16 +49,16 @@ module ActionController # around this you can return a <tt>303 See Other</tt> status code which will be # followed using a GET request. # - # redirect_to posts_url, :status => :see_other - # redirect_to :action => 'index', :status => 303 + # redirect_to posts_url, status: :see_other + # redirect_to action: 'index', status: 303 # # It is also possible to assign a flash message as part of the redirection. There are two special accessors for the commonly used flash names # +alert+ and +notice+ as well as a general purpose +flash+ bucket. # - # redirect_to post_url(@post), :alert => "Watch it, mister!" - # redirect_to post_url(@post), :status=> :found, :notice => "Pay attention to the road" - # redirect_to post_url(@post), :status => 301, :flash => { :updated_post_id => @post.id } - # redirect_to { :action=>'atom' }, :alert => "Something serious happened" + # redirect_to post_url(@post), alert: "Watch it, mister!" + # redirect_to post_url(@post), status: :found, notice: "Pay attention to the road" + # redirect_to post_url(@post), status: 301, flash: { updated_post_id: @post.id } + # redirect_to { action: 'atom' }, alert: "Something serious happened" # # When using <tt>redirect_to :back</tt>, if there is no referrer, ActionController::RedirectBackError will be raised. You may specify some fallback # behavior for this case by rescuing ActionController::RedirectBackError. |