Permalink
Browse files

removing a lolinject

  • Loading branch information...
tenderlove committed Aug 13, 2010
1 parent 3698da6 commit 79e15f03408a4a624000a40975465c0d632b5c8c
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -300,12 +300,12 @@ def options_for_select(container, selected = nil)
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

0 comments on commit 79e15f0

Please sign in to comment.