Skip to content
This repository
Browse code

Document the :shallow_path option for scope

  • Loading branch information...
commit 4ffd31e195d4af054e783f5d59bbb9f1ae170e4a 1 parent 020f74b
Ryan Bigg radar authored fxn committed

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. +19 0 actionpack/lib/action_dispatch/routing/mapper.rb
19 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -456,6 +456,25 @@ def initialize(*args) #:nodoc:
456 456 # end
457 457 #
458 458 # Helpers such as +posts_path+ will now be +sekret_posts_path+
  459 + #
  460 + # [:shallow_path]
  461 + #
  462 + # Prefixes nested shallow routes with the specified path.
  463 + #
  464 + # scope :shallow_path => "sekret" do
  465 + # resources :posts do
  466 + # resources :comments, :shallow => true
  467 + # end
  468 + #
  469 + # The +comments+ resource here will have the following routes generated for it:
  470 + #
  471 + # post_comments GET /sekret/posts/:post_id/comments(.:format)
  472 + # post_comments POST /sekret/posts/:post_id/comments(.:format)
  473 + # new_post_comment GET /sekret/posts/:post_id/comments/new(.:format)
  474 + # edit_comment GET /sekret/comments/:id/edit(.:format)
  475 + # comment GET /sekret/comments/:id(.:format)
  476 + # comment PUT /sekret/comments/:id(.:format)
  477 + # comment DELETE /sekret/comments/:id(.:format)
459 478 def scope(*args)
460 479 options = args.extract_options!
461 480 options = options.dup

0 comments on commit 4ffd31e

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