aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view/helpers/url_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index 3d86790a8f..f6b63cf115 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -102,6 +102,17 @@ module ActionView
# <%= url_for(:back) %>
# # if request.env["HTTP_REFERER"] is not set or is blank
# # => javascript:history.back()
+ # ==== Implicit Controller Namespace
+ #
+ # Controllers passed in will retain their namespace unless an absolute controller is specified with a slash
+ #
+ # # When called inside of the "admin" namespace
+ # <%= url_for(:action => 'index', :controller => 'users') %>
+ # # => /admin/users
+ #
+ # # Specify absolute path with beginning slash
+ # <%= url_for(:action => 'index', :controller => '/users') %>
+ # # => /users
def url_for(options = nil)
case options
when String