aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/base.rb16
-rw-r--r--actionpack/lib/action_view/helpers/form_helper.rb8
2 files changed, 16 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index e99e828730..413f6d48e5 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -252,7 +252,7 @@ module ActionController #:nodoc:
#
# def do_something
# redirect_to(:action => "elsewhere") and return if monkeys.nil?
- # render :action => "overthere" # won't be called unless monkeys is nil
+ # render :action => "overthere" # won't be called if monkeys is nil
# end
#
class Base
@@ -542,8 +542,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:
#
@@ -583,7 +583,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
diff --git a/actionpack/lib/action_view/helpers/form_helper.rb b/actionpack/lib/action_view/helpers/form_helper.rb
index 7bb82ba5bb..621e2946b5 100644
--- a/actionpack/lib/action_view/helpers/form_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_helper.rb
@@ -442,10 +442,10 @@ module ActionView
end
# Returns a checkbox tag tailored for accessing a specified attribute (identified by +method+) on an object
- # assigned to the template (identified by +object+). It's intended that +method+ returns an integer and if that
- # integer is above zero, then the checkbox is checked. Additional options on the input tag can be passed as a
- # hash with +options+. The +checked_value+ defaults to 1 while the default +unchecked_value+
- # is set to 0 which is convenient for boolean values.
+ # assigned to the template (identified by +object+). This object must be an instance object (@object) and not a local object.
+ # It's intended that +method+ returns an integer and if that integer is above zero, then the checkbox is checked.
+ # Additional options on the input tag can be passed as a hash with +options+. The +checked_value+ defaults to 1
+ # while the default +unchecked_value+ is set to 0 which is convenient for boolean values.
#
# ==== Gotcha
#