Permalink
Browse files

Add mention of nested resource to resources documentation

  • Loading branch information...
1 parent 38246b3 commit 0fcd39acd41325ca67ab2ca0472fac133ca8ab00 @radar radar committed with fxn Nov 23, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -934,6 +934,21 @@ def resource(*resources, &block)
# PUT /photos/:id
# DELETE /photos/:id
#
+ # Resources can also be nested infinitely by using this block syntax:
+ #
+ # resources :photos do
+ # resources :comments
+ # end
+ #
+ # This generates the following comments routes:
+ #
+ # GET /photos/:id/comments/new
+ # POST /photos/:id/comments
+ # GET /photos/:id/comments/:id
+ # GET /photos/:id/comments/:id/edit
+ # PUT /photos/:id/comments/:id
+ # DELETE /photos/:id/comments/:id
+ #
# === Supported options
# [:path_names]
# Allows you to change the paths of the seven default actions.

0 comments on commit 0fcd39a

Please sign in to comment.