aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/url_helper.rb
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2012-08-09 10:10:39 -0500
committerschneems <richard.schneeman@gmail.com>2012-08-09 10:10:39 -0500
commite4633519696f539bffacf6985caa3969ad717c85 (patch)
tree38ebd44115dd83d46b79337bcb396730bc4579d1 /actionpack/lib/action_view/helpers/url_helper.rb
parentd7f0e434ddae4b5d7505486b75eabc123b746d4a (diff)
downloadrails-e4633519696f539bffacf6985caa3969ad717c85.tar.gz
rails-e4633519696f539bffacf6985caa3969ad717c85.tar.bz2
rails-e4633519696f539bffacf6985caa3969ad717c85.zip
Document the namespacing of controller actions per this discussion:
https://github.com/rails/journey/issues/40
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