Permalink
Browse files

Provide an example for ActionDispatch::Routing::Mapper#scope

  • Loading branch information...
1 parent c6612d2 commit 751733ab963cce8780a71185344d8b31ba93c91d @radar radar committed Dec 11, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -458,6 +458,18 @@ def initialize(*args) #:nodoc:
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

0 comments on commit 751733a

Please sign in to comment.