aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorRusty Geldmacher <rgeldmacher@sermo.com>2012-07-10 15:03:37 -0400
committerRusty Geldmacher <rgeldmacher@sermo.com>2012-07-10 15:03:37 -0400
commit1a935ad7c647534f83ec03388ea1157b39eb6dcb (patch)
treeea3d49a0d02f0f1bd4cf9fbbb1a461485cf84517 /actionpack/lib/action_view
parent836016e5070ae96006584c5b7310264b0a27f89a (diff)
downloadrails-1a935ad7c647534f83ec03388ea1157b39eb6dcb.tar.gz
rails-1a935ad7c647534f83ec03388ea1157b39eb6dcb.tar.bz2
rails-1a935ad7c647534f83ec03388ea1157b39eb6dcb.zip
Fixed bug creating invalid HTML in select options
When a select tag is created for a field with errors, then the inserted options will errantly have a <div class="field_with_errors"> wrapping them.
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/helpers/form_options_helper.rb2
-rw-r--r--actionpack/lib/action_view/helpers/tags/base.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb
index eef426703d..72fbbd109a 100644
--- a/actionpack/lib/action_view/helpers/form_options_helper.rb
+++ b/actionpack/lib/action_view/helpers/form_options_helper.rb
@@ -353,7 +353,7 @@ module ActionView
html_attributes[:disabled] = 'disabled' if disabled && option_value_selected?(value, disabled)
html_attributes[:value] = value
- content_tag(:option, text, html_attributes)
+ content_tag_string(:option, text, html_attributes)
end.join("\n").html_safe
end
diff --git a/actionpack/lib/action_view/helpers/tags/base.rb b/actionpack/lib/action_view/helpers/tags/base.rb
index e077cd5b3c..192f5eebaa 100644
--- a/actionpack/lib/action_view/helpers/tags/base.rb
+++ b/actionpack/lib/action_view/helpers/tags/base.rb
@@ -137,10 +137,10 @@ module ActionView
def add_options(option_tags, options, value = nil)
if options[:include_blank]
- option_tags = content_tag('option', options[:include_blank].kind_of?(String) ? options[:include_blank] : nil, :value => '') + "\n" + option_tags
+ option_tags = content_tag_string('option', options[:include_blank].kind_of?(String) ? options[:include_blank] : nil, :value => '') + "\n" + option_tags
end
if value.blank? && options[:prompt]
- option_tags = content_tag('option', prompt_text(options[:prompt]), :value => '') + "\n" + option_tags
+ option_tags = content_tag_string('option', prompt_text(options[:prompt]), :value => '') + "\n" + option_tags
end
option_tags
end