diff options
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 4c830afb02..12a5f7f0f1 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -113,7 +113,6 @@ module ActionView options_for_select = container.inject([]) do |options, element| if !element.is_a?(String) and element.respond_to?(:first) and element.respond_to?(:last) - is_selected = ( (selected.respond_to?(:include?) ? selected.include?(element.last) : element.last == selected) ) is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element.last) : element.last == selected) ) if is_selected options << "<option value=\"#{html_escape(element.last.to_s)}\" selected=\"selected\">#{html_escape(element.first.to_s)}</option>" @@ -121,7 +120,6 @@ module ActionView options << "<option value=\"#{html_escape(element.last.to_s)}\">#{html_escape(element.first.to_s)}</option>" end else - is_selected = ( (selected.respond_to?(:include?) ? selected.include?(element) : element == selected) ) is_selected = ( (selected.respond_to?(:include?) && !selected.is_a?(String) ? selected.include?(element) : element == selected) ) options << ((is_selected) ? "<option value=\"#{html_escape(element.to_s)}\" selected=\"selected\">#{html_escape(element.to_s)}</option>" : "<option value=\"#{html_escape(element.to_s)}\">#{html_escape(element.to_s)}</option>") end |