Permalink
Browse files

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

  • Loading branch information...
1 parent 9254750 commit f5c15a481bb49b2408004470788167fafeaa472e @radar radar committed with fxn Dec 11, 2010
Showing with 12 additions and 0 deletions.
  1. +12 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -452,6 +452,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 f5c15a4

Please sign in to comment.