From 89d7133082159b7d0a456bd9b524be50149918b3 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Sat, 21 May 2011 07:11:21 +0100 Subject: Correct example and expand on description of :shallow option for resources --- actionpack/lib/action_dispatch/routing/mapper.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch') 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 /posts/a-long-permalink/comments/1234 + # to be shortened to just /comments/1234. # # [:shallow_path] # Prefixes nested shallow routes with the specified path. -- cgit v1.2.3