diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2011-05-21 07:11:21 +0100 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2011-05-21 07:11:47 +0100 |
commit | 89d7133082159b7d0a456bd9b524be50149918b3 (patch) | |
tree | fa0a14888a70ec179b770c06d62711ef4567bf01 /actionpack/lib/action_dispatch/routing/mapper.rb | |
parent | ea548c8df42215b08d33dd2808b2f5036c9d1996 (diff) | |
download | rails-89d7133082159b7d0a456bd9b524be50149918b3.tar.gz rails-89d7133082159b7d0a456bd9b524be50149918b3.tar.bz2 rails-89d7133082159b7d0a456bd9b524be50149918b3.zip |
Correct example and expand on description of :shallow option for resources
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 3ba6094fbb..c25f8c90bc 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -910,7 +910,7 @@ module ActionDispatch alias :member_name :singular - # Checks for uncountable plurals, and appends "_index" if the plural + # Checks for uncountable plurals, and appends "_index" if the plural # and singular form are the same. def collection_name singular == plural ? "#{plural}_index" : plural @@ -1083,9 +1083,13 @@ module ActionDispatch # Is the same as: # # resources :posts do - # resources :comments + # resources :comments, :except => [:show, :edit, :update, :destroy] # end - # resources :comments + # resources :comments, :only => [:show, :edit, :update, :destroy] + # + # This allows URLs for resources that otherwise would be deeply nested such + # as a comment on a blog post like <tt>/posts/a-long-permalink/comments/1234</tt> + # to be shortened to just <tt>/comments/1234</tt>. # # [:shallow_path] # Prefixes nested shallow routes with the specified path. |