diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 14:44:58 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-08-13 14:45:57 -0700 |
commit | 1f250415fe7ca2657f9d54a851e084b725c2e8ef (patch) | |
tree | 487f0ff68e9341cefb8439e874ce27e37260878a /actionpack/lib | |
parent | 919888503d481c3bd21a33acd3cd1018fc48f500 (diff) | |
download | rails-1f250415fe7ca2657f9d54a851e084b725c2e8ef.tar.gz rails-1f250415fe7ca2657f9d54a851e084b725c2e8ef.tar.bz2 rails-1f250415fe7ca2657f9d54a851e084b725c2e8ef.zip |
removing a lolinject
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/form_options_helper.rb | 4 |
1 files changed, 2 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 ee34452769..3c4d0b65f4 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -300,12 +300,12 @@ module ActionView container = container.to_a if Hash === container selected, disabled = extract_selected_and_disabled(selected) - options_for_select = container.inject([]) do |options, element| + options_for_select = container.map do |element| html_attributes = option_html_attributes(element) text, value = option_text_and_value(element) selected_attribute = ' selected="selected"' if option_value_selected?(value, selected) disabled_attribute = ' disabled="disabled"' if disabled && option_value_selected?(value, disabled) - options << %(<option value="#{html_escape(value.to_s)}"#{selected_attribute}#{disabled_attribute}#{html_attributes}>#{html_escape(text.to_s)}</option>) + %(<option value="#{html_escape(value.to_s)}"#{selected_attribute}#{disabled_attribute}#{html_attributes}>#{html_escape(text.to_s)}</option>) end options_for_select.join("\n").html_safe |