From 1c4eb13345a0c771aab2ee47aecdd4b24acce43a Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Mon, 22 Jul 2013 14:33:38 -0300 Subject: Leave the knowledge of boolean tag values to content tag content tag already knows which tags are boolean and the values that should generate them when a truthy value is passed, so leave this logic for it instead of duplicating when generating options tags. --- actionview/lib/action_view/helpers/form_options_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionview/lib/action_view/helpers/form_options_helper.rb') diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb index a9ee235e2a..e7f932ca06 100644 --- a/actionview/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -346,8 +346,8 @@ module ActionView html_attributes = option_html_attributes(element) text, value = option_text_and_value(element).map { |item| item.to_s } - html_attributes[:selected] = 'selected' if option_value_selected?(value, selected) - html_attributes[:disabled] = 'disabled' if disabled && option_value_selected?(value, disabled) + html_attributes[:selected] = option_value_selected?(value, selected) + html_attributes[:disabled] = disabled && option_value_selected?(value, disabled) html_attributes[:value] = value content_tag_string(:option, text, html_attributes) @@ -565,7 +565,7 @@ module ActionView end zone_options.safe_concat options_for_select(convert_zones[priority_zones], selected) - zone_options.safe_concat content_tag(:option, '-------------', value: '', disabled: 'disabled') + zone_options.safe_concat content_tag(:option, '-------------', value: '', disabled: true) zone_options.safe_concat "\n" zones = zones - priority_zones -- cgit v1.2.3