Browse files

Document the :as option for the scope method

  • Loading branch information...
1 parent ffe97e3 commit 7d83673134502b01bcb2fa3be07fdb84c61bb175 @radar radar committed Nov 7, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 actionpack/lib/action_dispatch/routing/mapper.rb
View
10 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -482,7 +482,17 @@ def initialize(*args) #:nodoc:
# scope :path => "/admin" do
# resources :posts
# end
+ #
# This will prefix all of the +posts+ resource's requests with '/admin'
+ #
+ # [:as]
+ # Prefixes the routing helpers in this scope with the specified label.
+ #
+ # scope :as => "sekret" do
+ # resources :posts
+ # end
+ #
+ # Helpers such as +posts_path+ will now be +sekret_posts_path+
def scope(*args)
options = args.extract_options!
options = options.dup

0 comments on commit 7d83673

Please sign in to comment.