Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

perofrmance trumps syntactical sugar

  • Loading branch information...
commit 92e4cfb0eba66e06972c208c086fe87530da9290 1 parent 8dcaf4d
@pkmiec pkmiec 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
@@ -299,12 +299,12 @@ def options_for_select(container, selected = nil)
container = container.to_a if Hash === container
selected, disabled = extract_selected_and_disabled(selected).map do | r |
- Array.wrap(r).map(&:to_s)
+ Array.wrap(r).map { |item| item.to_s }
end
container.map do |element|
html_attributes = option_html_attributes(element)
- text, value = option_text_and_value(element).map(&:to_s)
+ text, value = option_text_and_value(element).map { |item| item.to_s }
selected_attribute = ' selected="selected"' if option_value_selected?(value, selected)
disabled_attribute = ' disabled="disabled"' if disabled && option_value_selected?(value, disabled)
%(<option value="#{html_escape(value)}"#{selected_attribute}#{disabled_attribute}#{html_attributes}>#{html_escape(text)}</option>)
Please sign in to comment.
Something went wrong with that request. Please try again.