diff options
author | athonlab <akshay.surve@gmail.com> | 2008-09-25 18:34:24 +0530 |
---|---|---|
committer | athonlab <akshay.surve@gmail.com> | 2008-09-25 18:34:24 +0530 |
commit | d4379ca40a2fb1014859582a3e37f0a39036ea01 (patch) | |
tree | 7f3f10d35256ef936adc5b713d2dadc6dd3a4de3 /actionpack/lib/action_controller | |
parent | 6ed136d243b24b4c2ea37e7392217b9b166d1a9f (diff) | |
parent | 7a106af97f05e088b7bacbc1664001b7c869ca2a (diff) | |
download | rails-d4379ca40a2fb1014859582a3e37f0a39036ea01.tar.gz rails-d4379ca40a2fb1014859582a3e37f0a39036ea01.tar.bz2 rails-d4379ca40a2fb1014859582a3e37f0a39036ea01.zip |
Merge branch 'master' of git@github.com:lifo/docrails
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 457b9e85bc..fe168788e2 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -549,8 +549,8 @@ module ActionController #:nodoc: response end - # Returns a URL that has been rewritten according to the options hash and the defined Routes. - # (For doing a complete redirect, use redirect_to). + # Returns a URL that has been rewritten according to the options hash and the defined routes. + # (For doing a complete redirect, use +redirect_to+). # # <tt>url_for</tt> is used to: # @@ -590,7 +590,15 @@ module ActionController #:nodoc: # missing values in the current request's parameters. Routes attempts to guess when a value should and should not be # taken from the defaults. There are a few simple rules on how this is performed: # - # * If the controller name begins with a slash, no defaults are used: <tt>url_for :controller => '/home'</tt> + # * If the controller name begins with a slash no defaults are used: + # + # url_for :controller => '/home' + # + # In particular, a leading slash ensures no namespace is assumed. Thus, + # while <tt>url_for :controller => 'users'</tt> may resolve to + # <tt>Admin::UsersController</tt> if the current controller lives under + # that module, <tt>url_for :controller => '/users'</tt> ensures you link + # to <tt>::UsersController</tt> no matter what. # * If the controller changes, the action will default to index unless provided # # The final rule is applied while the URL is being generated and is best illustrated by an example. Let us consider the |