aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-11-07 10:38:45 +1000
committerRyan Bigg <radarlistener@gmail.com>2010-11-07 11:39:55 +1000
commit5040ecbfea931ba20439c7e84f2bdf261edd2732 (patch)
tree60ec35bcd14453a1b92f24f5835cd520fd190aa9 /actionpack/lib
parent35c7ca5c3728acffad42a9a77b98f4a098114de5 (diff)
downloadrails-5040ecbfea931ba20439c7e84f2bdf261edd2732.tar.gz
rails-5040ecbfea931ba20439c7e84f2bdf261edd2732.tar.bz2
rails-5040ecbfea931ba20439c7e84f2bdf261edd2732.zip
Document the :module and :path options for the scope method.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb17
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