diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 10:38:45 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 11:39:55 +1000 |
commit | 5040ecbfea931ba20439c7e84f2bdf261edd2732 (patch) | |
tree | 60ec35bcd14453a1b92f24f5835cd520fd190aa9 /actionpack | |
parent | 35c7ca5c3728acffad42a9a77b98f4a098114de5 (diff) | |
download | rails-5040ecbfea931ba20439c7e84f2bdf261edd2732.tar.gz rails-5040ecbfea931ba20439c7e84f2bdf261edd2732.tar.bz2 rails-5040ecbfea931ba20439c7e84f2bdf261edd2732.zip |
Document the :module and :path options for the scope method.
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 |