Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removing a lolinject

  • Loading branch information...
commit 1f250415fe7ca2657f9d54a851e084b725c2e8ef 1 parent 9198885
@tenderlove tenderlove authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 actionpack/lib/action_view/helpers/form_options_helper.rb
View
4 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

1 comment on commit 1f25041

@flavorjones

That's not a lolinject, that's a fancymap!

Please sign in to comment.
Something went wrong with that request. Please try again.