aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 34d49591e2..73c2ac3497 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -570,6 +570,14 @@ module ActionDispatch
# # 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,