5
votes

How do I output the full error message of a field using simple form? The equivalent of rails: <%= RESOURCE.errors.full_messages %>

e.g. show this:

"Email has already been taken", 
"Password confirmation doesn't match Password", 
"Password is too short (minimum is 8 characters)"

instead of: f.error_notification

"has already been taken", 
"doesn't match Password", 
"is too short (minimum is 8 characters)"

simple_form (3.0.2)/Rails 4.1.1

1
Would love to know the answer to this too!Richard Peck
I cheated. I couldn't make it work. So I disabled their auto error in the initializer and inserted f.full_error :token under each field. Though it works, I still rather have the auto version work....Cache

1 Answers

7
votes

If anyone is still wondering there is an easy way to do this now, as referenced here

Simply under config/initializers/simple_form.rb change b.user :error to b.user :full_error and now your error messages will be the equivalent of RESOURCE.errors.full_messages

Note: if you are using bootstrap w/ simple form you change simple_form_bootstrap.rb