aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/redirection.rb
diff options
context:
space:
mode:
authorAvnerCohen <israbirding@gmail.com>2012-10-31 21:19:44 +0200
committerAvnerCohen <israbirding@gmail.com>2012-10-31 21:19:44 +0200
commitd20a52930aa80d7f219465d6fc414a68b16ef2a8 (patch)
tree599a0f021b1b8a321fe0fafb426a885ae534f4c5 /actionpack/lib/action_dispatch/routing/redirection.rb
parentbe4a4cd38ff2c2db0f6b69bb72fb3557bd5a6e21 (diff)
downloadrails-d20a52930aa80d7f219465d6fc414a68b16ef2a8.tar.gz
rails-d20a52930aa80d7f219465d6fc414a68b16ef2a8.tar.bz2
rails-d20a52930aa80d7f219465d6fc414a68b16ef2a8.zip
1.9 hash syntax changes to docs
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/redirection.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/redirection.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb
index 205ff44b1c..1ed5eb1dff 100644
--- a/actionpack/lib/action_dispatch/routing/redirection.rb
+++ b/actionpack/lib/action_dispatch/routing/redirection.rb
@@ -102,7 +102,7 @@ module ActionDispatch
#
# You can also use interpolation in the supplied redirect argument:
#
- # match 'docs/:article', :to => redirect('/wiki/%{article}')
+ # match 'docs/:article', to: redirect('/wiki/%{article}')
#
# Alternatively you can use one of the other syntaxes:
#
@@ -111,7 +111,7 @@ module ActionDispatch
# params, depending of how many arguments your block accepts. A string is required as a
# return value.
#
- # match 'jokes/:number', :to => redirect { |params, request|
+ # match 'jokes/:number', to: redirect { |params, request|
# path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp")
# "http://#{request.host_with_port}/#{path}"
# }
@@ -122,8 +122,8 @@ module ActionDispatch
# The options version of redirect allows you to supply only the parts of the url which need
# to change, it also supports interpolation of the path similar to the first example.
#
- # match 'stores/:name', :to => redirect(:subdomain => 'stores', :path => '/%{name}')
- # match 'stores/:name(*all)', :to => redirect(:subdomain => 'stores', :path => '/%{name}%{all}')
+ # match 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}')
+ # match 'stores/:name(*all)', to: redirect(subdomain: 'stores', path: '/%{name}%{all}')
#
# Finally, an object which responds to call can be supplied to redirect, allowing you to reuse
# common redirect routes. The call method must accept two arguments, params and request, and return