Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allow HTML tags in error notifications messages

  • Loading branch information...
commit 9dfff667a778416e0ccf2a10f7010a8a53f7058f 1 parent 18b73dd
@edison authored
View
2  lib/simple_form/error_notification.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
View
6 test/form_builder/error_notification_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.