Making escaped things more readable

This commit is contained in:
Santiago Pastorino
2010-03-14 13:11:07 -03:00
committed by wycats
parent 3da9a08a73
commit beeb02076a
3 changed files with 3 additions and 3 deletions

View File

@@ -129,7 +129,7 @@ module ActionView
if (obj = (object.respond_to?(:errors) ? object : instance_variable_get("@#{object}"))) &&
(errors = obj.errors[method])
content_tag("div",
(options[:prepend_text].html_safe << errors.first).safe_concat(options[:append_text]),
"#{options[:prepend_text]}#{ERB::Util.h(errors.first)}#{options[:append_text]}".html_safe,
:class => options[:css_class]
)
else

View File

@@ -109,7 +109,7 @@ module ActionView
def content_tag_string(name, content, options, escape = true)
tag_options = tag_options(options, escape) if options
("<#{name}#{tag_options}>".html_safe << content.to_s).safe_concat("</#{name}>")
"<#{name}#{tag_options}>#{ERB::Util.h(content)}</#{name}>".html_safe
end
def tag_options(options, escape = true)

View File

@@ -224,7 +224,7 @@ module ActionView
end
href_attr = "href=\"#{url}\"" unless href
("<a #{href_attr}#{tag_options}>".html_safe << (name || url)).safe_concat("</a>")
"<a #{href_attr}#{tag_options}>#{ERB::Util.h(name || url)}</a>".html_safe
end
end