From b2c7d2345f3e862f07212635f2a144873e094521 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Mon, 25 Nov 2013 09:32:32 -0200 Subject: Revert "Merge pull request #13027 from akshay-vishnoi/f-refactor" This reverts commit f4a5a9ea4d183f4102796215d4502c46dbe3e52b, reversing changes made to 7ccb482181ee6c47c765406009018a15172812de. 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). --- actionview/lib/action_view/helpers/form_options_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionview') diff --git a/actionview/lib/action_view/helpers/form_options_helper.rb b/actionview/lib/action_view/helpers/form_options_helper.rb index 3e54d2daaa..4347983bad 100644 --- a/actionview/lib/action_view/helpers/form_options_helper.rb +++ b/actionview/lib/action_view/helpers/form_options_helper.rb @@ -361,7 +361,7 @@ module ActionView text, value = option_text_and_value(element).map { |item| item.to_s } 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 content_tag_string(:option, text, html_attributes) -- cgit v1.2.3