Permalink
Browse files

Document the :module and :path options for the scope method.

  • Loading branch information...
1 parent 35c7ca5 commit 5040ecbfea931ba20439c7e84f2bdf261edd2732 @radar radar committed Nov 7, 2010
Showing with 13 additions and 4 deletions.
  1. +13 −4 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -467,12 +467,21 @@ def initialize(*args) #:nodoc:
# Used to route <tt>/photos</tt> (without the prefix <tt>/admin</tt>)
# to Admin::PostsController:
+ # === Supported options
+ # [:module]
+ # If you want to route /posts (without the prefix /admin) to
+ # Admin::PostsController, you could use
#
- # Examples:
+ # scope :module => "admin" do
+ # resources :posts
+ # end
+ # [:path]
+ # If you want to prefix the route, you could use
#
- # scope :module => "admin" do
- # resources :posts
- # end
+ # scope :path => "/admin" do
+ # resources :posts
+ # end
+ # This will prefix all of the +posts+ resource's requests with '/admin'
def scope(*args)
options = args.extract_options!
options = options.dup

0 comments on commit 5040ecb

Please sign in to comment.