Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

avoiding calling of #option_value_selected? two times
  • Loading branch information...
commit f4a5a9ea4d183f4102796215d4502c46dbe3e52b 2 parents 7ccb482 + 0f2ef7b
@senny senny authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  actionview/lib/action_view/helpers/form_options_helper.rb
View
2  actionview/lib/action_view/helpers/form_options_helper.rb
@@ -361,7 +361,7 @@ def options_for_select(container, selected = nil)
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[:disabled] = disabled && html_attributes[:selected]
html_attributes[:value] = value
content_tag_string(:option, text, html_attributes)
Please sign in to comment.
Something went wrong with that request. Please try again.