aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2008-03-20 02:15:29 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2008-03-20 02:15:29 +0000
commit54213dadfde64e163d841056238b3c463aaa4212 (patch)
tree39fe86a2c5e79a1a67008fcbac34acf13caa4c15 /actionpack/lib
parente87d3e333588b8455c2b6d81219adb860c2f4baa (diff)
downloadrails-54213dadfde64e163d841056238b3c463aaa4212.tar.gz
rails-54213dadfde64e163d841056238b3c463aaa4212.tar.bz2
rails-54213dadfde64e163d841056238b3c463aaa4212.zip
Docfixes (closes #11356, #11172, #10523)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9064 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index 67be4d81f0..5b026245da 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -53,6 +53,21 @@ module ActionView
# <option value="2">Sam</option>
# <option value="3">Tobias</option>
# </select>
+ #
+ # Like the other form helpers, +select+ can accept an <tt>:index</tt> option to manually set the ID used in the resulting output. Unlike other helpers, +select+ expects this
+ # option to be in the +html_options+ parameter.
+ #
+ # Example:
+ #
+ # select("album[]", "genre", %w[rap rock country], {}, { :index => nil })
+ #
+ # becomes:
+ #
+ # <select name="album[][genre]" id="album__genre">
+ # <option value="rap">rap</option>
+ # <option value="rock">rock</option>
+ # <option value="country">country</option>
+ # </select>
module FormOptionsHelper
include ERB::Util