From 5040ecbfea931ba20439c7e84f2bdf261edd2732 Mon Sep 17 00:00:00 2001 From: Ryan Bigg Date: Sun, 7 Nov 2010 10:38:45 +1000 Subject: Document the :module and :path options for the scope method. --- actionpack/lib/action_dispatch/routing/mapper.rb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_dispatch') 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 /photos (without the prefix /admin) # 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 -- cgit v1.2.3