Permalink
Browse files

add cross-references and documentation for scope

  • Loading branch information...
1 parent 49744bd commit 38d728fb944b08b7faabf19c8ba5ef2e69e29c16 Jonathan Dance + Gabriel Horner committed Jan 28, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 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,

0 comments on commit 38d728f

Please sign in to comment.