mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Begin to document the namespace method for AD's Mapper
This commit is contained in:
parent
e5eece41b5
commit
379939e1e0
1 changed files with 15 additions and 0 deletions
|
@ -529,6 +529,21 @@ module ActionDispatch
|
||||||
scope(options) { yield }
|
scope(options) { yield }
|
||||||
end
|
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 = {})
|
def namespace(path, options = {})
|
||||||
path = path.to_s
|
path = path.to_s
|
||||||
options = { :path => path, :as => path, :module => path,
|
options = { :path => path, :as => path, :module => path,
|
||||||
|
|
Loading…
Reference in a new issue