aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_options_helper.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-05-09 05:19:32 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-05-09 05:19:32 +0000
commit5a960d2568b5c2f69c31379045a224489a5ac3d1 (patch)
tree26150af984d5284fd4f3822defca8e1290e5bc20 /actionpack/lib/action_view/helpers/form_options_helper.rb
parentd249ff579a1a4bcdf0bc1491771934b7478f5778 (diff)
downloadrails-5a960d2568b5c2f69c31379045a224489a5ac3d1.tar.gz
rails-5a960d2568b5c2f69c31379045a224489a5ac3d1.tar.bz2
rails-5a960d2568b5c2f69c31379045a224489a5ac3d1.zip
Excise ingrown code from FormOptionsHelper#options_for_select. Closes #5008.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4331 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view/helpers/form_options_helper.rb')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb2
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