Skip to content
This repository
Browse code

Use html_safe translated messages. This will let you use this format:…

… "<strong>%{attribute}</strong> %{message}" and renders it properly
  • Loading branch information...
commit 172badd9ecda0dde25efbd596d088a8819a268de 1 parent b1cf9d9
Nicolás Hock Isaza authored April 10, 2011
4  lib/generators/nifty/layout/templates/error_messages_helper.rb
@@ -7,8 +7,8 @@ def error_messages_for(*objects)
7 7
     messages = objects.compact.map { |o| o.errors.full_messages }.flatten
8 8
     unless messages.empty?
9 9
       content_tag(:div, :class => "error_messages") do
10  
-        list_items = messages.map { |msg| content_tag(:li, msg) }
11  
-        content_tag(:h2, options[:header_message]) + content_tag(:p, options[:message]) + content_tag(:ul, list_items.join.html_safe)
  10
+        list_items = messages.map { |msg| content_tag(:li, msg.html_safe) }
  11
+        content_tag(:h2, options[:header_message].html_safe) + content_tag(:p, options[:message].html_safe) + content_tag(:ul, list_items.join.html_safe)
12 12
       end
13 13
     end
14 14
   end

0 notes on commit 172badd

Please sign in to comment.
Something went wrong with that request. Please try again.