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

Revert "Merge pull request #13027 from akshay-vishnoi/f-refactor"

This reverts commit f4a5a9ea4d, reversing
changes made to 7ccb482181.

Reason:

The logic is different, the first call to #option_value_selected? is for
the :selected option (the argument is the "selected" variable), the second
call is for the :disabled option (the argument is the "disabled" variable).
This commit is contained in:
Carlos Antonio da Silva 2013-11-25 09:32:32 -02:00
parent f4a5a9ea4d
commit b2c7d2345f

View file

@ -361,7 +361,7 @@ module ActionView
text, value = option_text_and_value(element).map { |item| item.to_s } text, value = option_text_and_value(element).map { |item| item.to_s }
html_attributes[:selected] = option_value_selected?(value, selected) html_attributes[:selected] = option_value_selected?(value, selected)
html_attributes[:disabled] = disabled && html_attributes[:selected] html_attributes[:disabled] = disabled && option_value_selected?(value, disabled)
html_attributes[:value] = value html_attributes[:value] = value
content_tag_string(:option, text, html_attributes) content_tag_string(:option, text, html_attributes)