1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Do not overwrite selected and disabled attributes

This commit is contained in:
Laura Paredes 2014-03-30 20:23:46 +02:00
parent fd5739c94a
commit be521ef6ac

View file

@ -360,8 +360,8 @@ module ActionView
html_attributes = option_html_attributes(element)
text, value = option_text_and_value(element).map { |item| item.to_s }
html_attributes[:selected] = option_value_selected?(value, selected)
html_attributes[:disabled] = 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)