aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_options_helper.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-05-25 12:29:00 +0100
committerPratik Naik <pratiknaik@gmail.com>2008-05-25 12:29:00 +0100
commit98dc582742779081e71e697fcdf8d9ae2b421b16 (patch)
treef5680eef86e689a10d0f75434ba6a4e94829e439 /actionpack/lib/action_view/helpers/form_options_helper.rb
parent6277fd91133a3566333612857510d74de60d67f4 (diff)
downloadrails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.gz
rails-98dc582742779081e71e697fcdf8d9ae2b421b16.tar.bz2
rails-98dc582742779081e71e697fcdf8d9ae2b421b16.zip
Merge docrails.
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb40
1 files changed, 19 insertions, 21 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index 6f3818659e..e0a097e367 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -119,7 +119,7 @@ module ActionView
# end
# end
#
- # Sample usage (selecting the associated +Author+ for an instance of +Post+, <tt>@post</tt>):
+ # Sample usage (selecting the associated Author for an instance of Post, <tt>@post</tt>):
# collection_select(:post, :author_id, Author.find(:all), :id, :name_with_initial, {:prompt => true})
#
# If <tt>@post.author_id</tt> is already <tt>1</tt>, this would return:
@@ -144,7 +144,7 @@ module ActionView
# In addition to the <tt>:include_blank</tt> option documented above,
# this method also supports a <tt>:model</tt> option, which defaults
# to TimeZone. This may be used by users to specify a different time
- # zone model object. (See #time_zone_options_for_select for more
+ # zone model object. (See +time_zone_options_for_select+ for more
# information.)
#
# You can also supply an array of TimeZone objects
@@ -153,7 +153,7 @@ module ActionView
# obtaining a list of the US time zones.)
#
# Finally, this method supports a <tt>:default</tt> option, which selects
- # a default TimeZone if the object's time zone is nil.
+ # a default TimeZone if the object's time zone is +nil+.
#
# Examples:
# time_zone_select( "user", "time_zone", nil, :include_blank => true)
@@ -172,7 +172,7 @@ module ActionView
# Accepts a container (hash, array, enumerable, your type) and returns a string of option tags. Given a container
# where the elements respond to first and last (such as a two-element array), the "lasts" serve as option values and
# the "firsts" as option text. Hashes are turned into this form automatically, so the keys become "firsts" and values
- # become lasts. If +selected+ is specified, the matching "last" or element will get the selected option-tag. +Selected+
+ # become lasts. If +selected+ is specified, the matching "last" or element will get the selected option-tag. +selected+
# may also be an array of values to be selected when using a multiple select.
#
# Examples (call, result):
@@ -217,24 +217,22 @@ module ActionView
options_for_select(options, selected)
end
- # Returns a string of <tt><option></tt> tags, like <tt>#options_from_collection_for_select</tt>, but
+ # Returns a string of <tt><option></tt> tags, like <tt>options_from_collection_for_select</tt>, but
# groups them by <tt><optgroup></tt> tags based on the object relationships of the arguments.
#
# Parameters:
- # +collection+:: An array of objects representing the <tt><optgroup></tt> tags
- # +group_method+:: The name of a method which, when called on a member of +collection+, returns an
- # array of child objects representing the <tt><option></tt> tags
- # +group_label_method+:: The name of a method which, when called on a member of +collection+, returns a
- # string to be used as the +label+ attribute for its <tt><optgroup></tt> tag
- # +option_key_method+:: The name of a method which, when called on a child object of a member of
- # +collection+, returns a value to be used as the +value+ attribute for its
- # <tt><option></tt> tag
- # +option_value_method+:: The name of a method which, when called on a child object of a member of
- # +collection+, returns a value to be used as the contents of its
- # <tt><option></tt> tag
- # +selected_key+:: A value equal to the +value+ attribute for one of the <tt><option></tt> tags,
- # which will have the +selected+ attribute set. Corresponds to the return value
- # of one of the calls to +option_key_method+. If +nil+, no selection is made.
+ # * +collection+ - An array of objects representing the <tt><optgroup></tt> tags.
+ # * +group_method+ - The name of a method which, when called on a member of +collection+, returns an
+ # array of child objects representing the <tt><option></tt> tags.
+ # * group_label_method+ - The name of a method which, when called on a member of +collection+, returns a
+ # string to be used as the +label+ attribute for its <tt><optgroup></tt> tag.
+ # * +option_key_method+ - The name of a method which, when called on a child object of a member of
+ # +collection+, returns a value to be used as the +value+ attribute for its <tt><option></tt> tag.
+ # * +option_value_method+ - The name of a method which, when called on a child object of a member of
+ # +collection+, returns a value to be used as the contents of its <tt><option></tt> tag.
+ # * +selected_key+ - A value equal to the +value+ attribute for one of the <tt><option></tt> tags,
+ # which will have the +selected+ attribute set. Corresponds to the return value of one of the calls
+ # to +option_key_method+. If +nil+, no selection is made.
#
# Example object structure for use with this method:
# class Continent < ActiveRecord::Base
@@ -300,8 +298,8 @@ module ActionView
# a TimeZone.
#
# By default, +model+ is the TimeZone constant (which can be obtained
- # in ActiveRecord as a value object). The only requirement is that the
- # +model+ parameter be an object that responds to #all, and returns
+ # in Active Record as a value object). The only requirement is that the
+ # +model+ parameter be an object that responds to +all+, and returns
# an array of objects that represent time zones.
#
# NOTE: Only the option tags are returned, you have to wrap this call in