Update routing doc on the get to: option [ci skip]

This commit is contained in:
Dzianis Dashkevich 2017-04-11 18:50:05 +03:00
parent c134a17b3d
commit 04b9d68297
No known key found for this signature in database
GPG Key ID: C4AC27C1413E38DF

@ -142,10 +142,10 @@ Sometimes, you have a resource that clients always look up without referencing a
get 'profile', to: 'users#show'
```
Passing a `String` to `get` will expect a `controller#action` format, while passing a `Symbol` will map directly to an action but you must also specify the `controller:` to use:
Passing a `String` to `to:` will expect a `controller#action` format. When using a `Symbol`, the `to:` option should be replaced with `action:`. When using a `String` without a `#`, the `to:` option should be replaced with `controller:`:
```ruby
get 'profile', to: :show, controller: 'users'
get 'profile', action: :show, controller: 'users'
```
This resourceful route: