aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/routing.textile
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-03-09 00:07:59 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-03-09 00:07:59 +0530
commit188d1d27876018c492280059b3d721be9afcc231 (patch)
tree20037458a5814681e78858c93eef14cc893ffe44 /railties/guides/source/routing.textile
parent085cb3b9af9d74fa9a3b72181f674f0b7c3dbf01 (diff)
parent97e7d43146b6edca19891d8c7ed6b4d93e7dad00 (diff)
downloadrails-188d1d27876018c492280059b3d721be9afcc231.tar.gz
rails-188d1d27876018c492280059b3d721be9afcc231.tar.bz2
rails-188d1d27876018c492280059b3d721be9afcc231.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/guides/source/routing.textile')
-rw-r--r--railties/guides/source/routing.textile18
1 files changed, 9 insertions, 9 deletions
diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile
index c5567b3350..e93b1280e0 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)+).
@@ -389,7 +389,7 @@ match ':controller/:action/:id/:user_id'
An incoming path of +/photos/show/1/2+ will be dispatched to the +show+ action of the +PhotosController+. +params[:id]+ will be +"1"+, and +params[:user_id]+ will be +"2"+.
-NOTE: You can't use +namespace+ or +:module+ with a +:controller+ path segment. If you need to do this then use a constraint on :controller that matches the namespace you require. e.g:
+NOTE: You can't use +:namespace+ or +:module+ with a +:controller+ path segment. If you need to do this then use a constraint on :controller that matches the namespace you require. e.g:
<ruby>
match ':controller(/:action(/:id))', :controller => /admin\/[^\/]+/