aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/routing.md
diff options
context:
space:
mode:
authorFlorent Guilleux <florent2@gmail.com>2012-12-10 18:47:21 -0500
committerFlorent Guilleux <florent2@gmail.com>2012-12-10 18:47:21 -0500
commit336bbb17e335323c0828165dd8f8f09b627664f1 (patch)
tree1d6cd3bff217873c549efbb5b149e7310efb4cbe /guides/source/routing.md
parentd4d9e1f9bf2388a34dc6b7b9473ee14cda3166df (diff)
downloadrails-336bbb17e335323c0828165dd8f8f09b627664f1.tar.gz
rails-336bbb17e335323c0828165dd8f8f09b627664f1.tar.bz2
rails-336bbb17e335323c0828165dd8f8f09b627664f1.zip
Document adding member route without the option
Diffstat (limited to 'guides/source/routing.md')
-rw-r--r--guides/source/routing.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/guides/source/routing.md b/guides/source/routing.md
index 241a7cfec6..5bf31a1583 100644
--- a/guides/source/routing.md
+++ b/guides/source/routing.md
@@ -471,7 +471,7 @@ resources :photos do
end
```
-This will recognize `/photos/1/preview` with GET, and route to the `preview` action of `PhotosController`. It will also create the `preview_photo_url` and `preview_photo_path` helpers.
+This will recognize `/photos/1/preview` with GET, and route to the `preview` action of `PhotosController`, with the resource id value passed in `params[:id]`. It will also create the `preview_photo_url` and `preview_photo_path` helpers.
Within the block of member routes, each route name specifies the HTTP verb that it will recognize. You can use `get`, `patch`, `put`, `post`, or `delete` here. If you don't have multiple `member` routes, you can also pass `:on` to a route, eliminating the block:
@@ -481,6 +481,8 @@ resources :photos do
end
```
+You can leave out the `:on` option, this will create the same member route except that the resource id value will be available in `params[:photo_id]` instead of `params[:id]`.
+
#### Adding Collection Routes
To add a route to the collection: