From 38d728fb944b08b7faabf19c8ba5ef2e69e29c16 Mon Sep 17 00:00:00 2001 From: Jonathan Dance + Gabriel Horner Date: Fri, 28 Jan 2011 17:01:48 -0500 Subject: add cross-references and documentation for scope --- actionpack/lib/action_dispatch/routing.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/lib/action_dispatch/routing.rb') 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 Routing::Mapper::Resources#resources, + # Routing::Mapper::Scoping#namespace, and + # Routing::Mapper::Scoping#scope. + # # == Named routes # # Routes can be named by passing an :as option, -- cgit v1.2.3