aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing.rb
diff options
context:
space:
mode:
authorJonathan Dance + Gabriel Horner <ghorner+jd+gh@wegowise.com>2011-01-28 17:01:48 -0500
committerJonathan Dance + Gabriel Horner <ghorner+jd+gh@wegowise.com>2011-01-28 19:25:12 -0500
commit38d728fb944b08b7faabf19c8ba5ef2e69e29c16 (patch)
treee15f9d8c0986c8f31e1f475e87c9f20b2b5113a7 /actionpack/lib/action_dispatch/routing.rb
parent49744bdaee899d64f8c70f65b2c1d63ace41cafa (diff)
downloadrails-38d728fb944b08b7faabf19c8ba5ef2e69e29c16.tar.gz
rails-38d728fb944b08b7faabf19c8ba5ef2e69e29c16.tar.bz2
rails-38d728fb944b08b7faabf19c8ba5ef2e69e29c16.zip
add cross-references and documentation for scope
Diffstat (limited to 'actionpack/lib/action_dispatch/routing.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing.rb b/actionpack/lib/action_dispatch/routing.rb
index 8810227a59..43fd93adf6 100644
--- a/actionpack/lib/action_dispatch/routing.rb
+++ b/actionpack/lib/action_dispatch/routing.rb
@@ -56,6 +56,18 @@ module ActionDispatch
# resources :posts, :comments
# end
#
+ # Alternately, you can add prefixes to your path without using a separate
+ # directory by using +scope+. +scope+ takes additional options which
+ # apply to all enclosed routes.
+ #
+ # scope :path => "/cpanel", :as => 'admin' do
+ # resources :posts, :comments
+ # end
+ #
+ # For more, see <tt>Routing::Mapper::Resources#resources</tt>,
+ # <tt>Routing::Mapper::Scoping#namespace</tt>, and
+ # <tt>Routing::Mapper::Scoping#scope</tt>.
+ #
# == Named routes
#
# Routes can be named by passing an <tt>:as</tt> option,