Skip to content
Browse files

Merge pull request #11303 from evsyukovmv/specify-request-method-in-g…

…uides

Specify request method in guides [ci skip]
  • Loading branch information...
2 parents 3caf9a7 + 867138a commit f3f46a6f4ac2a1fd2dd6fa9af245641f32c9bc59 @carlosantoniodasilva carlosantoniodasilva committed Jul 4, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 guides/source/action_controller_overview.md
  2. +1 −1 guides/source/i18n.md
View
2 guides/source/action_controller_overview.md
@@ -160,7 +160,7 @@ NOTE: Support for parsing XML parameters has been extracted into a gem named `ac
The `params` hash will always contain the `:controller` and `:action` keys, but you should use the methods `controller_name` and `action_name` instead to access these values. Any other parameters defined by the routing, such as `:id` will also be available. As an example, consider a listing of clients where the list can show either active or inactive clients. We can add a route which captures the `:status` parameter in a "pretty" URL:
```ruby
-match '/clients/:status' => 'clients#index', foo: 'bar'
+get '/clients/:status' => 'clients#index', foo: 'bar'
```
In this case, when a user opens the URL `/clients/active`, `params[:status]` will be set to "active". When this route is used, `params[:foo]` will also be set to "bar" just like it was passed in the query string. In the same way `params[:action]` will contain "index".
View
2 guides/source/i18n.md
@@ -253,7 +253,7 @@ You would probably need to map URLs like these:
```ruby
# config/routes.rb
-match '/:locale' => 'dashboard#index'
+get '/:locale' => 'dashboard#index'
```
Do take special care about the **order of your routes**, so this route declaration does not "eat" other ones. (You may want to add it directly before the `root :to` declaration.)

0 comments on commit f3f46a6

Please sign in to comment.
Something went wrong with that request. Please try again.