Permalink
Browse files

Document the :as option for the scope method

  • Loading branch information...
1 parent 0db8412 commit 06402b03ea561cf70ebc51b29cbebd5ca7aa9f0d @radar radar committed with fxn Nov 7, 2010
Showing with 10 additions and 0 deletions.
  1. +10 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -445,7 +445,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 06402b0

Please sign in to comment.