Skip to content

Commit

Permalink
missings html_safe added
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino authored and Yehuda Katz committed Feb 19, 2010
1 parent 64d28f6 commit 2491175
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions actionpack/lib/action_view/helpers/active_record_helper.rb
Expand Up @@ -121,7 +121,7 @@ def error_message_on(object, method, *args)
if (obj = (object.respond_to?(:errors) ? object : instance_variable_get("@#{object}"))) &&
(errors = obj.errors.on(method))
content_tag("div",
"#{options[:prepend_text]}#{ERB::Util.html_escape(errors.is_a?(Array) ? errors.first : errors)}#{options[:append_text]}",
"#{options[:prepend_text]}#{ERB::Util.html_escape(errors.is_a?(Array) ? errors.first : errors)}#{options[:append_text]}".html_safe,
:class => options[:css_class]
)
else
Expand Down Expand Up @@ -198,14 +198,14 @@ def error_messages_for(*params)
locale.t :header, :count => count, :model => object_name
end
message = options.include?(:message) ? options[:message] : locale.t(:body)
error_messages = objects.sum {|object| object.errors.full_messages.map {|msg| content_tag(:li, ERB::Util.html_escape(msg)) } }.join
error_messages = objects.sum {|object| object.errors.full_messages.map {|msg| content_tag(:li, ERB::Util.html_escape(msg)) } }.join.html_safe

contents = ''
contents << content_tag(options[:header_tag] || :h2, header_message) unless header_message.blank?
contents << content_tag(:p, message) unless message.blank?
contents << content_tag(:ul, error_messages)

content_tag(:div, contents, html)
content_tag(:div, contents.html_safe, html)
end
else
''
Expand Down
6 changes: 3 additions & 3 deletions actionpack/lib/action_view/helpers/date_helper.rb
Expand Up @@ -815,7 +815,7 @@ def build_options(selected, options = {})
tag_options[:selected] = "selected" if selected == i
select_options << content_tag(:option, value, tag_options)
end
select_options.join("\n") + "\n"
(select_options.join("\n") + "\n").html_safe
end

# Builds select tag from date type and html select options
Expand All @@ -833,9 +833,9 @@ def build_select(type, select_options_as_html)
select_html = "\n"
select_html << content_tag(:option, '', :value => '') + "\n" if @options[:include_blank]
select_html << prompt_option_tag(type, @options[:prompt]) + "\n" if @options[:prompt]
select_html << select_options_as_html.to_s
select_html << select_options_as_html

(content_tag(:select, select_html, select_options) + "\n").html_safe
(content_tag(:select, select_html.html_safe, select_options) + "\n").html_safe
end

# Builds a prompt option tag with supplied options or from default options
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/form_tag_helper.rb
Expand Up @@ -262,7 +262,7 @@ def text_area_tag(name, content = nil, options = {})
escape = options.key?("escape") ? options.delete("escape") : true
content = html_escape(content) if escape

content_tag :textarea, content, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
content_tag :textarea, content.html_safe, { "name" => name, "id" => sanitize_to_id(name) }.update(options.stringify_keys)
end

# Creates a check box form input tag.
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/helpers/javascript_helper.rb
Expand Up @@ -184,7 +184,7 @@ def javascript_tag(content_or_options_with_block = nil, html_options = {}, &bloc
end

def javascript_cdata_section(content) #:nodoc:
"\n//#{cdata_section("\n#{content}\n//")}\n"
"\n//#{cdata_section("\n#{content}\n//")}\n".html_safe
end

protected
Expand Down

0 comments on commit 2491175

Please sign in to comment.