From e4633519696f539bffacf6985caa3969ad717c85 Mon Sep 17 00:00:00 2001 From: schneems Date: Thu, 9 Aug 2012 10:10:39 -0500 Subject: Document the namespacing of controller actions per this discussion: https://github.com/rails/journey/issues/40 --- actionpack/lib/action_view/helpers/url_helper.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actionpack') 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 -- cgit v1.2.3