diff options
author | schneems <richard.schneeman@gmail.com> | 2012-08-09 10:10:39 -0500 |
---|---|---|
committer | schneems <richard.schneeman@gmail.com> | 2012-08-09 10:10:39 -0500 |
commit | e4633519696f539bffacf6985caa3969ad717c85 (patch) | |
tree | 38ebd44115dd83d46b79337bcb396730bc4579d1 /actionpack | |
parent | d7f0e434ddae4b5d7505486b75eabc123b746d4a (diff) | |
download | rails-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')
-rw-r--r-- | actionpack/lib/action_view/helpers/url_helper.rb | 11 |
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 |