Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Document the :as option for the namespace method

  • Loading branch information...
commit 6ca042b3e4078b694e827e0f3de51712a0cb4420 1 parent 66d1276
@radar radar authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 actionpack/lib/action_dispatch/routing/mapper.rb
View
8 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -570,6 +570,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,
Please sign in to comment.
Something went wrong with that request. Please try again.