1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Correct example and expand on description of :shallow option for resources

This commit is contained in:
Andrew White 2011-05-21 07:11:21 +01:00
parent ea548c8df4
commit 89d7133082

View file

@ -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.