Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: edison/simple_form
base: 312796b1ee
...
head fork: edison/simple_form
compare: 9dfff667a7
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
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
View
6 test/form_builder/error_test.rb
@@ -73,6 +73,12 @@ def with_full_error_for(object, *args)
assert_no_select 'p.error[error_method]'
end
+ test 'error should generate an error message with raw HTML tags' do
+ with_error_for @user, :name, :error_prefix => '<b>Name</b>'
+ assert_select 'span.error', "Name can't be blank"
+ assert_select 'span.error b', "Name"
+ end
+
# FULL ERRORS
test 'full error should generate an full error tag for the attribute' do

No commit comments for this range

Something went wrong with that request. Please try again.