Permalink
Browse files

allow HTML tags in error notifications messages

  • Loading branch information...
1 parent 18b73dd commit 9dfff667a778416e0ccf2a10f7010a8a53f7058f @edison committed Feb 16, 2012
Showing with 7 additions and 1 deletion.
  1. +1 −1 lib/simple_form/error_notification.rb
  2. +6 −0 test/form_builder/error_notification_test.rb
@@ -25,7 +25,7 @@ def has_errors?
end
def error_message
- @message || translate_error_notification
+ (@message || translate_error_notification).html_safe
end
def error_notification_tag
@@ -60,4 +60,10 @@ def with_error_notification_for(object, options={}, &block)
assert_select 'div.error_notification'
end
end
+
+ test 'error notification should contain HTML tags' do
+ with_error_notification_for @user, :message => 'Erro encontrado ao criar <b>usuario</b>'
+ assert_select 'p.error_notification', 'Erro encontrado ao criar usuario'
+ assert_select 'p.error_notification b', 'usuario'
+ end
end

0 comments on commit 9dfff66

Please sign in to comment.