diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-06-23 17:33:42 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-06-23 17:33:42 +0000 |
commit | 5715a9900ccc161ffde2f02bc256afd4b2e74cc8 (patch) | |
tree | 34089b6db6154a680a5b46e77f9d7142e5a25ae5 | |
parent | 183b7131d0592dc21225ee98fbe3f42ecdddf842 (diff) | |
download | rails-5715a9900ccc161ffde2f02bc256afd4b2e74cc8.tar.gz rails-5715a9900ccc161ffde2f02bc256afd4b2e74cc8.tar.bz2 rails-5715a9900ccc161ffde2f02bc256afd4b2e74cc8.zip |
Docfix (closes #8321)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7100 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/lib/action_controller/resources.rb | 19 |
1 files changed, 15 insertions, 4 deletions
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) # # * <tt>:name_prefix</tt> - 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 <tt>map.resources</tt> is called with multiple resources, they all get the same options applied. # # Examples: |