Permalink
Browse files

Add mention of nested resource to resources documentation

  • Loading branch information...
1 parent fd47a4b commit e4a9af186a7316e2de018ff9306442b9fe0f2400 @radar radar committed Nov 23, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -968,6 +968,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 e4a9af1

Please sign in to comment.