aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
authorCesar Carruitero <cesar@mozilla.pe>2012-11-08 17:12:23 -0500
committerCesar Carruitero <cesar@mozilla.pe>2012-11-08 17:16:57 -0500
commit5fe385ba931217edea254f3e6d14538f0801105c (patch)
treeb42c81bf1924fd1fe189e61c18055ff2a9acbd06 /actionpack/lib/action_dispatch/routing
parent6eb4271d91557e39c07c45d608a31b3370d88439 (diff)
downloadrails-5fe385ba931217edea254f3e6d14538f0801105c.tar.gz
rails-5fe385ba931217edea254f3e6d14538f0801105c.tar.bz2
rails-5fe385ba931217edea254f3e6d14538f0801105c.zip
change match to get and add single quotes in routing/redirection [ci-skip]
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/redirection.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb
index 1ed5eb1dff..c8566aed81 100644
--- a/actionpack/lib/action_dispatch/routing/redirection.rb
+++ b/actionpack/lib/action_dispatch/routing/redirection.rb
@@ -98,11 +98,11 @@ module ActionDispatch
# Redirect any path to another path:
#
- # match "/stories" => redirect("/posts")
+ # get '/stories', to: redirect('/posts')
#
# You can also use interpolation in the supplied redirect argument:
#
- # match 'docs/:article', to: redirect('/wiki/%{article}')
+ # get 'docs/:article', to: redirect('/wiki/%{article}')
#
# Alternatively you can use one of the other syntaxes:
#
@@ -111,25 +111,25 @@ 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|
- # path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp")
+ # get 'jokes/:number', to: redirect { |params, request|
+ # path = (params[:number].to_i.even? ? 'wheres-the-beef' : 'i-love-lamp')
# "http://#{request.host_with_port}/#{path}"
# }
#
# Note that the +do end+ syntax for the redirect block wouldn't work, as Ruby would pass
- # the block to +match+ instead of +redirect+. Use <tt>{ ... }</tt> instead.
+ # the block to +get+ instead of +redirect+. Use <tt>{ ... }</tt> instead.
#
# 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}')
+ # get 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}')
+ # get '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
# a string.
#
- # match 'accounts/:name' => redirect(SubdomainRedirector.new('api'))
+ # get 'accounts/:name', to: redirect(SubdomainRedirector.new('api'))
#
def redirect(*args, &block)
options = args.extract_options!