diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-13 01:00:01 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-05-13 01:00:01 -0300 |
commit | a8cfaed3389de8c12ad8c8e363df13bd93354ab4 (patch) | |
tree | eeda43a98880df9f068f572c342dcef420b69cfc /guides | |
parent | 871b1c2115182e7273b75b76518733374a9883b3 (diff) | |
parent | 2e9c7cd5f603dd27015cddb17c6ea328e9baa0d5 (diff) | |
download | rails-a8cfaed3389de8c12ad8c8e363df13bd93354ab4.tar.gz rails-a8cfaed3389de8c12ad8c8e363df13bd93354ab4.tar.bz2 rails-a8cfaed3389de8c12ad8c8e363df13bd93354ab4.zip |
Merge pull request #6225 from acapilleri/select_with_required_true_include_first_option_blank
HTML5 validation error with options_from_collection_for_select
Fixes #5908
Conflicts:
actionpack/CHANGELOG.md
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/form_helpers.textile | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/guides/source/form_helpers.textile b/guides/source/form_helpers.textile index b6420db798..b2c05492ab 100644 --- a/guides/source/form_helpers.textile +++ b/guides/source/form_helpers.textile @@ -405,6 +405,8 @@ Whenever Rails sees that the internal value of an option being generated matches TIP: The second argument to +options_for_select+ must be exactly equal to the desired internal value. In particular if the value is the integer 2 you cannot pass "2" to +options_for_select+ -- you must pass 2. Be aware of values extracted from the +params+ hash as they are all strings. +WARNING: +:include_blank+ is forced true if the attributes +required+ is true, display +size+ is one and +multiple+ is not true. + h4. Select Boxes for Dealing with Models In most cases form controls will be tied to a specific database model and as you might expect Rails provides helpers tailored for that purpose. Consistent with other form helpers, when dealing with models you drop the +_tag+ suffix from +select_tag+: |