Skip to content
This repository
Browse code

Add mention of nested resource to resources documentation

  • Loading branch information...
commit e4a9af186a7316e2de018ff9306442b9fe0f2400 1 parent fd47a4b
Ryan Bigg authored November 24, 2010
15  actionpack/lib/action_dispatch/routing/mapper.rb
@@ -968,6 +968,21 @@ def resource(*resources, &block)
968 968
         #   PUT     /photos/:id
969 969
         #   DELETE  /photos/:id
970 970
         #
  971
+        # Resources can also be nested infinitely by using this block syntax:
  972
+        #
  973
+        #   resources :photos do
  974
+        #     resources :comments
  975
+        #   end
  976
+        #
  977
+        # This generates the following comments routes:
  978
+        #
  979
+        #   GET     /photos/:id/comments/new
  980
+        #   POST    /photos/:id/comments
  981
+        #   GET     /photos/:id/comments/:id
  982
+        #   GET     /photos/:id/comments/:id/edit
  983
+        #   PUT     /photos/:id/comments/:id
  984
+        #   DELETE  /photos/:id/comments/:id
  985
+        #
971 986
         # === Supported options
972 987
         # [:path_names]
973 988
         #   Allows you to change the paths of the seven default actions.

0 notes on commit e4a9af1

Please sign in to comment.
Something went wrong with that request. Please try again.