aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorRyan Bigg <radarlistener@gmail.com>2010-11-07 12:07:29 +1000
committerRyan Bigg <radarlistener@gmail.com>2010-11-07 12:07:41 +1000
commit6ca042b3e4078b694e827e0f3de51712a0cb4420 (patch)
treee41693c4d8b064237f21cbcf8c2158e331ab5532 /actionpack/lib/action_dispatch/routing/mapper.rb
parent66d1276d7f38ddb002f1dd48e77cea383497f57d (diff)
downloadrails-6ca042b3e4078b694e827e0f3de51712a0cb4420.tar.gz
rails-6ca042b3e4078b694e827e0f3de51712a0cb4420.tar.bz2
rails-6ca042b3e4078b694e827e0f3de51712a0cb4420.zip
Document the :as option for the namespace method
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-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,