diff options
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 4 | ||||
-rw-r--r-- | actionpack/test/template/form_options_helper_test.rb | 12 |
3 files changed, 10 insertions, 8 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 7641c24ead..1ee499c69e 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add 'disabled' attribute to <OPTION> separators used in time zone and country selects. Closes #10354 [hasmanyjosh] + * Added the same record identification guessing rules to fields_for as form_for has [DHH] * Fixed that verification violations with no specified action didn't halt the chain (now they do with a 400 Bad Request) [DHH] diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index e7d375cabb..10d539b413 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -249,7 +249,7 @@ module ActionView if priority_countries country_options += options_for_select(priority_countries, selected) - country_options += "<option value=\"\">-------------</option>\n" + country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n" end return country_options + options_for_select(COUNTRIES, selected) @@ -280,7 +280,7 @@ module ActionView if priority_zones zone_options += options_for_select(convert_zones[priority_zones], selected) - zone_options += "<option value=\"\">-------------</option>\n" + zone_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n" zones = zones.reject { |z| priority_zones.include?( z ) } end diff --git a/actionpack/test/template/form_options_helper_test.rb b/actionpack/test/template/form_options_helper_test.rb index e34e36f4e3..3d45984b83 100644 --- a/actionpack/test/template/form_options_helper_test.rb +++ b/actionpack/test/template/form_options_helper_test.rb @@ -187,7 +187,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase opts = time_zone_options_for_select( nil, zones ) assert_dom_equal "<option value=\"B\">B</option>\n" + "<option value=\"E\">E</option>" + - "<option value=\"\">-------------</option>\n" + + "<option value=\"\" disabled=\"disabled\">-------------</option>\n" + "<option value=\"A\">A</option>\n" + "<option value=\"C\">C</option>\n" + "<option value=\"D\">D</option>", @@ -199,7 +199,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase opts = time_zone_options_for_select( "E", zones ) assert_dom_equal "<option value=\"B\">B</option>\n" + "<option value=\"E\" selected=\"selected\">E</option>" + - "<option value=\"\">-------------</option>\n" + + "<option value=\"\" disabled=\"disabled\">-------------</option>\n" + "<option value=\"A\">A</option>\n" + "<option value=\"C\">C</option>\n" + "<option value=\"D\">D</option>", @@ -211,7 +211,7 @@ class FormOptionsHelperTest < Test::Unit::TestCase opts = time_zone_options_for_select( "C", zones ) assert_dom_equal "<option value=\"B\">B</option>\n" + "<option value=\"E\">E</option>" + - "<option value=\"\">-------------</option>\n" + + "<option value=\"\" disabled=\"disabled\">-------------</option>\n" + "<option value=\"A\">A</option>\n" + "<option value=\"C\" selected=\"selected\">C</option>\n" + "<option value=\"D\">D</option>", @@ -663,7 +663,7 @@ COUNTRIES @post.origin = "Denmark" expected_select = <<-COUNTRIES <select id="post_origin" name="post[origin]"><option value="New Zealand">New Zealand</option> -<option value="Nicaragua">Nicaragua</option><option value="">-------------</option> +<option value="Nicaragua">Nicaragua</option><option value="" disabled="disabled">-------------</option> <option value="Afghanistan">Afghanistan</option> <option value="Aland Islands">Aland Islands</option> <option value="Albania">Albania</option> @@ -919,7 +919,7 @@ COUNTRIES @post.origin = "New Zealand" expected_select = <<-COUNTRIES <select id="post_origin" name="post[origin]"><option selected="selected" value="New Zealand">New Zealand</option> -<option value="Nicaragua">Nicaragua</option><option value="">-------------</option> +<option value="Nicaragua">Nicaragua</option><option value="" disabled="disabled">-------------</option> <option value="Afghanistan">Afghanistan</option> <option value="Aland Islands">Aland Islands</option> <option value="Albania">Albania</option> @@ -1289,7 +1289,7 @@ COUNTRIES assert_dom_equal "<select id=\"firm_time_zone\" name=\"firm[time_zone]\">" + "<option value=\"A\">A</option>\n" + "<option value=\"D\" selected=\"selected\">D</option>" + - "<option value=\"\">-------------</option>\n" + + "<option value=\"\" disabled=\"disabled\">-------------</option>\n" + "<option value=\"B\">B</option>\n" + "<option value=\"C\">C</option>\n" + "<option value=\"E\">E</option>" + |