From 38411b89fc6b1ddf29a39fed174b8b7dd0951764 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 9 Nov 2012 15:40:52 -0200 Subject: Use get in the redirection doc examples get is the most common usage, and match without an explicit verb was disallowed in 56cdc81c08b1847c5c1f699810a8c3b9ac3715a6. [ci skip] --- actionpack/lib/action_dispatch/routing/redirection.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/routing/redirection.rb b/actionpack/lib/action_dispatch/routing/redirection.rb index 1ed5eb1dff..d70063d0e9 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" => 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| + # 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 { ... } instead. + # the block to +get+ instead of +redirect+. Use { ... } 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' => redirect(SubdomainRedirector.new('api')) # def redirect(*args, &block) options = args.extract_options! -- cgit v1.2.3