aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2012-08-16 00:05:47 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2012-08-16 00:05:47 +0530
commit62499bcb9d8aa65636f5cd3ace2a818ffd4e2f8a (patch)
tree31ec770099f65758ae0113a86397375f92c7e269 /actionpack/lib
parent925f07fed9bb29af64788061cf41762eaad1b5eb (diff)
downloadrails-62499bcb9d8aa65636f5cd3ace2a818ffd4e2f8a.tar.gz
rails-62499bcb9d8aa65636f5cd3ace2a818ffd4e2f8a.tar.bz2
rails-62499bcb9d8aa65636f5cd3ace2a818ffd4e2f8a.zip
copy edits [ci skip]
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/url_helper.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb
index f6b63cf115..fe3240fdc1 100644
--- a/actionpack/lib/action_view/helpers/url_helper.rb
+++ b/actionpack/lib/action_view/helpers/url_helper.rb
@@ -60,11 +60,15 @@ module ActionView
#
# ==== Relying on named routes
#
- # Passing a record (like an Active Record) instead of a Hash as the options parameter will
+ # Passing a record (like an Active Record) instead of a hash as the options parameter will
# trigger the named route for that record. The lookup will happen on the name of the class. So passing a
# Workshop object will attempt to use the +workshop_path+ route. If you have a nested route, such as
# +admin_workshop_path+ you'll have to call that explicitly (it's impossible for +url_for+ to guess that route).
#
+ # ==== Implicit Controller Namespacing
+ #
+ # Controllers passed in using the +:controller+ option will retain their namespace unless it is an absolute one.
+ #
# ==== Examples
# <%= url_for(:action => 'index') %>
# # => /blog/
@@ -102,16 +106,13 @@ 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') %>
+ # # Assuming an "admin" namespace
# # => /admin/users
#
- # # Specify absolute path with beginning slash
# <%= url_for(:action => 'index', :controller => '/users') %>
+ # # Specify absolute path with beginning slash
# # => /users
def url_for(options = nil)
case options