Permalink
Browse files

add some more detail on nested resource docs [Rick]

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5878 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 5bf40f7 commit 398c1a504c75f48e60dcf4daf3e705064ad1c4e2 @technoweenie technoweenie committed Jan 10, 2007
Showing with 9 additions and 1 deletion.
  1. +9 −1 actionpack/lib/action_controller/resources.rb
@@ -162,7 +162,15 @@ def add_default_action(collection, method, action)
# map.resources :articles do |article|
# article.resources :comments
# end
- #
+ #
+ # The comment resources work the same, but must now include a value for :article_id.
+ #
+ # comments_url(@article)
+ # comment_url(@article, @comment)
+ #
+ # comments_url(:article_id => @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.
#

0 comments on commit 398c1a5

Please sign in to comment.