From 5715a9900ccc161ffde2f02bc256afd4b2e74cc8 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 23 Jun 2007 17:33:42 +0000 Subject: Docfix (closes #8321) git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7100 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/resources.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb index f0937dbcb8..d6c83dabcb 100644 --- a/actionpack/lib/action_controller/resources.rb +++ b/actionpack/lib/action_controller/resources.rb @@ -238,11 +238,11 @@ module ActionController # # The comment resources work the same, but must now include a value for :article_id. # - # comments_url(@article) - # comment_url(@article, @comment) + # article_comments_url(@article) + # article_comment_url(@article, @comment) # - # comments_url(:article_id => @article) - # comment_url(:article_id => @article, :id => @comment) + # article_comments_url(:article_id => @article) + # article_comment_url(:article_id => @article, :id => @comment) # # * :name_prefix - define a prefix for all generated routes, usually ending in an underscore. # Use this if you have named routes that may clash. @@ -250,6 +250,17 @@ module ActionController # map.resources :tags, :path_prefix => '/books/:book_id', :name_prefix => 'book_' # map.resources :tags, :path_prefix => '/toys/:toy_id', :name_prefix => 'toy_' # + # You may also use :name_prefix to override the generic named routes in a nested resource: + # + # map.resources :articles do |article| + # article.resources :comments, :name_prefix => nil + # end + # + # This will yield named resources like so: + # + # comments_url(@article) + # comment_url(@article, @comment) + # # If map.resources is called with multiple resources, they all get the same options applied. # # Examples: -- cgit v1.2.3