diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-07-22 14:33:38 -0300 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2013-07-22 14:39:45 -0300 |
commit | 1c4eb13345a0c771aab2ee47aecdd4b24acce43a (patch) | |
tree | 7ccac62fdd9826f6eed028be916a3f9c7d37c722 /actionview/lib/action_view | |
parent | b973852febaac607cb7a602e10b8c04e320822e1 (diff) | |
download | rails-1c4eb13345a0c771aab2ee47aecdd4b24acce43a.tar.gz rails-1c4eb13345a0c771aab2ee47aecdd4b24acce43a.tar.bz2 rails-1c4eb13345a0c771aab2ee47aecdd4b24acce43a.zip |
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.
Diffstat (limited to 'actionview/lib/action_view')
-rw-r--r-- | actionview/lib/action_view/helpers/form_options_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 |