Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
Merged pull request #98 from nhocki/master.
Browse files Browse the repository at this point in the history
Use html_safe for error_messages_for helper. Let's you use HTML in your translations.
  • Loading branch information
ryanb committed Apr 25, 2011
2 parents 581e389 + 172badd commit 2363790
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ def error_messages_for(*objects)
messages = objects.compact.map { |o| o.errors.full_messages }.flatten
unless messages.empty?
content_tag(:div, :class => "error_messages") do
list_items = messages.map { |msg| content_tag(:li, msg) }
content_tag(:h2, options[:header_message]) + content_tag(:p, options[:message]) + content_tag(:ul, list_items.join.html_safe)
list_items = messages.map { |msg| content_tag(:li, msg.html_safe) }
content_tag(:h2, options[:header_message].html_safe) + content_tag(:p, options[:message].html_safe) + content_tag(:ul, list_items.join.html_safe)
end
end
end
Expand Down

0 comments on commit 2363790

Please sign in to comment.