Skip to content
Browse files

Document the namespacing of controller actions per this discussion:

  • Loading branch information...
1 parent d7f0e43 commit e4633519696f539bffacf6985caa3969ad717c85 @schneems schneems committed Aug 9, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 actionpack/lib/action_view/helpers/url_helper.rb
View
11 actionpack/lib/action_view/helpers/url_helper.rb
@@ -102,6 +102,17 @@ def optimize_routes_generation? #:nodoc:
# <%= 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

0 comments on commit e463351

Please sign in to comment.
Something went wrong with that request. Please try again.