mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Document the :module and :path options for the scope method.
This commit is contained in:
parent
35c7ca5c37
commit
5040ecbfea
1 changed files with 13 additions and 4 deletions
|
@ -467,12 +467,21 @@ module ActionDispatch
|
||||||
|
|
||||||
# Used to route <tt>/photos</tt> (without the prefix <tt>/admin</tt>)
|
# Used to route <tt>/photos</tt> (without the prefix <tt>/admin</tt>)
|
||||||
# to Admin::PostsController:
|
# to Admin::PostsController:
|
||||||
#
|
# === Supported options
|
||||||
# Examples:
|
# [:module]
|
||||||
|
# If you want to route /posts (without the prefix /admin) to
|
||||||
|
# Admin::PostsController, you could use
|
||||||
#
|
#
|
||||||
# scope :module => "admin" do
|
# scope :module => "admin" do
|
||||||
# resources :posts
|
# resources :posts
|
||||||
# end
|
# end
|
||||||
|
# [:path]
|
||||||
|
# If you want to prefix the route, you could use
|
||||||
|
#
|
||||||
|
# scope :path => "/admin" do
|
||||||
|
# resources :posts
|
||||||
|
# end
|
||||||
|
# This will prefix all of the +posts+ resource's requests with '/admin'
|
||||||
def scope(*args)
|
def scope(*args)
|
||||||
options = args.extract_options!
|
options = args.extract_options!
|
||||||
options = options.dup
|
options = options.dup
|
||||||
|
|
Loading…
Reference in a new issue