aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/resources.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/resources.rb')
-rw-r--r--actionpack/lib/action_controller/resources.rb19
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: