diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 12:04:25 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2010-11-07 12:04:25 +1000 |
commit | 379939e1e00519e819c71a53c28f9032f473aa04 (patch) | |
tree | c95e891195aa5a8eff5d17c251f1403725079db5 /actionpack/lib/action_dispatch/routing | |
parent | e5eece41b5ac740f8a137b3228d052273c641099 (diff) | |
download | rails-379939e1e00519e819c71a53c28f9032f473aa04.tar.gz rails-379939e1e00519e819c71a53c28f9032f473aa04.tar.bz2 rails-379939e1e00519e819c71a53c28f9032f473aa04.zip |
Begin to document the namespace method for AD's Mapper
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 48afca56d8..10b1342f30 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -529,6 +529,21 @@ module ActionDispatch scope(options) { yield } end + # Scopes routes to a specific namespace. For example: + # + # namespace :admin do + # resources :posts + # end + # + # This generates the following routes: + # + # admin_posts GET /admin/posts(.:format) {:action=>"index", :controller=>"admin/posts"} + # admin_posts POST /admin/posts(.:format) {:action=>"create", :controller=>"admin/posts"} + # new_admin_post GET /admin/posts/new(.:format) {:action=>"new", :controller=>"admin/posts"} + # edit_admin_post GET /admin/posts/:id/edit(.:format) {:action=>"edit", :controller=>"admin/posts"} + # admin_post GET /admin/posts/:id(.:format) {:action=>"show", :controller=>"admin/posts"} + # admin_post PUT /admin/posts/:id(.:format) {:action=>"update", :controller=>"admin/posts"} + # admin_post DELETE /admin/posts/:id(.:format) {:action=>"destroy", :controller=>"admin/posts"} def namespace(path, options = {}) path = path.to_s options = { :path => path, :as => path, :module => path, |