diff options
author | Ryan Bigg <radarlistener@gmail.com> | 2010-12-11 17:25:28 +1000 |
---|---|---|
committer | Ryan Bigg <radarlistener@gmail.com> | 2010-12-11 17:27:14 +1000 |
commit | 751733ab963cce8780a71185344d8b31ba93c91d (patch) | |
tree | 4b137e9e1c7be2932c276ece6fbff431cb366d81 /actionpack/lib | |
parent | c6612d2bb34e7104a7b1be0dedb0e1ad9596f160 (diff) | |
download | rails-751733ab963cce8780a71185344d8b31ba93c91d.tar.gz rails-751733ab963cce8780a71185344d8b31ba93c91d.tar.bz2 rails-751733ab963cce8780a71185344d8b31ba93c91d.zip |
Provide an example for ActionDispatch::Routing::Mapper#scope
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 430fcdbe07..45248cf34c 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -458,6 +458,18 @@ module ActionDispatch super end + # Used to scope a set of routes to particular constraints. + # + # Take the following route definition as an example: + # + # scope :path => ":account_id", :as => "account" do + # resources :projects + # end + # + # This generates helpers such as +account_projects_path+, just like +resources+ does. + # The difference here being that the routes generated are like /rails/projects/2, + # rather than /accounts/rails/projects/2. + # # === Supported options # [:module] # If you want to route /posts (without the prefix /admin) to |