Permalink
Browse files

Document the :shallow_path option for scope

  • Loading branch information...
radar authored and fxn committed Nov 7, 2010
1 parent 020f74b commit 4ffd31e195d4af054e783f5d59bbb9f1ae170e4a
Showing with 19 additions and 0 deletions.
  1. +19 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -456,6 +456,25 @@ def initialize(*args) #:nodoc:
# end
#
# Helpers such as +posts_path+ will now be +sekret_posts_path+
+ #
+ # [:shallow_path]
+ #
+ # Prefixes nested shallow routes with the specified path.
+ #
+ # scope :shallow_path => "sekret" do
+ # resources :posts do
+ # resources :comments, :shallow => true
+ # end
+ #
+ # The +comments+ resource here will have the following routes generated for it:
+ #
+ # post_comments GET /sekret/posts/:post_id/comments(.:format)
+ # post_comments POST /sekret/posts/:post_id/comments(.:format)
+ # new_post_comment GET /sekret/posts/:post_id/comments/new(.:format)
+ # edit_comment GET /sekret/comments/:id/edit(.:format)
+ # comment GET /sekret/comments/:id(.:format)
+ # comment PUT /sekret/comments/:id(.:format)
+ # comment DELETE /sekret/comments/:id(.:format)
def scope(*args)
options = args.extract_options!
options = options.dup

0 comments on commit 4ffd31e

Please sign in to comment.