diff options
author | coreyhaines <coreyhaines@gmail.com> | 2012-03-06 20:43:48 -0600 |
---|---|---|
committer | coreyhaines <coreyhaines@gmail.com> | 2012-03-06 20:43:48 -0600 |
commit | 4b89b90e93486d7ff99ccc429bc24c46adb0cb9f (patch) | |
tree | ba5c98aae44462d8d57f7931f57be42eab5e9e63 /railties/guides/source | |
parent | cf1d97504893ed050da62b30de55d5f67b2a6f69 (diff) | |
download | rails-4b89b90e93486d7ff99ccc429bc24c46adb0cb9f.tar.gz rails-4b89b90e93486d7ff99ccc429bc24c46adb0cb9f.tar.bz2 rails-4b89b90e93486d7ff99ccc429bc24c46adb0cb9f.zip |
In a nested resource route, the parent resource param is <resource_name>_id
Diffstat (limited to 'railties/guides/source')
-rw-r--r-- | railties/guides/source/routing.textile | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 42665114be..001b507c3b 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -234,14 +234,14 @@ end In addition to the routes for magazines, this declaration will also route ads to an +AdsController+. The ad URLs require a magazine: -|_.HTTP Verb |_.Path |_.action |_.used for | -|GET |/magazines/:id/ads |index |display a list of all ads for a specific magazine | -|GET |/magazines/:id/ads/new |new |return an HTML form for creating a new ad belonging to a specific magazine | -|POST |/magazines/:id/ads |create |create a new ad belonging to a specific magazine | -|GET |/magazines/:id/ads/:id |show |display a specific ad belonging to a specific magazine | -|GET |/magazines/:id/ads/:id/edit |edit |return an HTML form for editing an ad belonging to a specific magazine | -|PATCH/PUT |/magazines/:id/ads/:id |update |update a specific ad belonging to a specific magazine | -|DELETE |/magazines/:id/ads/:id |destroy |delete a specific ad belonging to a specific magazine | +|_.HTTP Verb |_.Path |_.action |_.used for | +|GET |/magazines/:magazine_id/ads |index |display a list of all ads for a specific magazine | +|GET |/magazines/:magazine_id/ads/new |new |return an HTML form for creating a new ad belonging to a specific magazine | +|POST |/magazines/:magazine_id/ads |create |create a new ad belonging to a specific magazine | +|GET |/magazines/:magazine_id/ads/:id |show |display a specific ad belonging to a specific magazine | +|GET |/magazines/:magazine_id/ads/:id/edit |edit |return an HTML form for editing an ad belonging to a specific magazine | +|PATCH/PUT |/magazines/:magazine_id/ads/:id |update |update a specific ad belonging to a specific magazine | +|DELETE |/magazines/:magazine_id/ads/:id |destroy |delete a specific ad belonging to a specific magazine | This will also create routing helpers such as +magazine_ads_url+ and +edit_magazine_ad_path+. These helpers take an instance of Magazine as the first parameter (+magazine_ads_url(@magazine)+). |