diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-09-13 06:52:07 -0500 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2008-09-13 06:52:07 -0500 |
commit | ae3dcd3de6da95a7c4ac2e9f99e5be812c4b9e45 (patch) | |
tree | efd3593d913d8e445b4c085952250dc6f592c2fd /railties/doc/guides/routing | |
parent | 837392132afd1c0ba8888f01649d1620b73c3626 (diff) | |
download | rails-ae3dcd3de6da95a7c4ac2e9f99e5be812c4b9e45.tar.gz rails-ae3dcd3de6da95a7c4ac2e9f99e5be812c4b9e45.tar.bz2 rails-ae3dcd3de6da95a7c4ac2e9f99e5be812c4b9e45.zip |
Changes for routing from the outside in guide
Fix some lingering typos.
Add a description to the index page.
Diffstat (limited to 'railties/doc/guides/routing')
-rw-r--r-- | railties/doc/guides/routing/routing_outside_in.txt | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/railties/doc/guides/routing/routing_outside_in.txt b/railties/doc/guides/routing/routing_outside_in.txt index 1a4b1a9530..7b5d25a0dd 100644 --- a/railties/doc/guides/routing/routing_outside_in.txt +++ b/railties/doc/guides/routing/routing_outside_in.txt @@ -127,7 +127,7 @@ In Rails, a RESTful route provides a mapping between HTTP verbs, controller acti [source, ruby] ------------------------------------------------------- -map.resources photos +map.resources :photos ------------------------------------------------------- creates seven different routes in your application: @@ -174,7 +174,7 @@ You can also apply RESTful routing to singleton resources within your applicatio [source, ruby] ------------------------------------------------------- -map.resource geocoder +map.resource :geocoder ------------------------------------------------------- creates seven different routes in your application: @@ -220,7 +220,7 @@ The +:controller+ option lets you use a controller name that is different from t [source, ruby] ------------------------------------------------------- -map.resources photos, :controller => "images" +map.resources :photos, :controller => "images" ------------------------------------------------------- will recognize incoming URLs containing +photo+ but route the requests to the Images controller: @@ -257,7 +257,7 @@ You an use the +:requirements+ option in a RESTful route to impose a format on t [source, ruby] ------------------------------------------------------- -map.resources photos, :requirements => {:id => /[A-Z][A-Z][0-9]+/} +map.resources :photos, :requirements => {:id => /[A-Z][A-Z][0-9]+/} ------------------------------------------------------- This declaration constrains the +:id+ parameter to match the supplied regular expression. So, in this case, +/photos/1+ would no longer be recognized by this route, but +/photos/RR27+ would. @@ -272,7 +272,7 @@ The +:as+ option lets you override the normal naming for the actual generated pa [source, ruby] ------------------------------------------------------- -map.resources photos, :as => "images" +map.resources :photos, :as => "images" ------------------------------------------------------- will recognize incoming URLs containing +image+ but route the requests to the Photos controller: @@ -298,7 +298,7 @@ The +:path_names+ option lets you override the automatically-generated "new" and [source, ruby] ------------------------------------------------------- -map.resources photos, :path_names => { :new => 'make', :edit => 'change' } +map.resources :photos, :path_names => { :new => 'make', :edit => 'change' } ------------------------------------------------------- This would cause the routing to recognize URLs such as @@ -323,7 +323,7 @@ The +:path_prefix+ option lets you add additional parameters that will be prefix [source, ruby] ------------------------------------------------------- -map.resources photos, :path_prefix => '/photographers/:photographer_id' +map.resources :photos, :path_prefix => '/photographers/:photographer_id' ------------------------------------------------------- Routes recognized by this entry would include: @@ -341,8 +341,8 @@ You can use the :name_prefix option to avoid collisions between routes. This is [source, ruby] ------------------------------------------------------- -map.resources photos, :path_prefix => '/photographers/:photographer_id', :name_prefix => 'photographer_' -map.resources photos, :path_prefix => '/agencies/:agency_id', :name_prefix => 'agency_' +map.resources :photos, :path_prefix => '/photographers/:photographer_id', :name_prefix => 'photographer_' +map.resources :photos, :path_prefix => '/agencies/:agency_id', :name_prefix => 'agency_' ------------------------------------------------------- This combination will give you route helpers such as +photographer_photos_path+ and +agency_photo_edit_path+ to use in your code. |