diff options
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index d21e1285b3..9ff7481c1f 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -467,12 +467,21 @@ module ActionDispatch # 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 |