Permalink
Browse files

Document the :as option for the namespace method

  • Loading branch information...
1 parent 4228318 commit 45525713f98c09ed3984525557d5ebd264d1025e @radar radar committed with fxn Nov 7, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -538,6 +538,14 @@ def controller(controller, options={})
# # code go here
# end
#
+ # [:as]
+ # Changes the name used in routing helpers for this namespace.
+ #
+ # namespace :admin, :as => "sekret" do
+ # resources :posts
+ # end
+ #
+ # Routing helpers such as +admin_posts_path+ will now be +sekret_posts_path+.
def namespace(path, options = {})
path = path.to_s
options = { :path => path, :as => path, :module => path,

0 comments on commit 4552571

Please sign in to comment.