aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_options_helper.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-02-17 19:38:02 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-02-17 19:38:02 +0000
commit96d3f152227b31e1ca2f0ac2814dda741dccaaea (patch)
tree3adcad6ff7482f7a7bf8921f6378c34357b90ff3 /actionpack/lib/action_view/helpers/form_options_helper.rb
parent7cac2b5e73165d17eb42f0031deb6485513b980b (diff)
downloadrails-96d3f152227b31e1ca2f0ac2814dda741dccaaea.tar.gz
rails-96d3f152227b31e1ca2f0ac2814dda741dccaaea.tar.bz2
rails-96d3f152227b31e1ca2f0ac2814dda741dccaaea.zip
Documentation on :include_blank #579
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@654 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb13
1 files changed, 13 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 aa448764da..2c321b8336 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -5,6 +5,19 @@ require File.dirname(__FILE__) + '/form_helper'
module ActionView
module Helpers
# Provides a number of methods for turning different kinds of containers into a set of option tags.
+ # == Options
+ # The <tt>collection_select</tt>, <tt>country_select</tt>, and <tt>select</tt> methods take an <tt>options</tt> parameter, a hash.
+ #
+ # * <tt>:include_blank</tt> - set to true if the first option element of the select element is a blank. Useful if there is not a default value required for the select element.
+ # select("post", "category", Post::CATEGORIES, {:include_blank => true})
+ #
+ # Could become:
+ #
+ # <select name="post[category]">
+ # <option></option>
+ # <option>joke</option>
+ # <option>poem</option>
+ # </select>
module FormOptionsHelper
include ERB::Util