Show basic errors with simple_form

I have errors in the model as opposed to the model fields, so they are added to the [: base] errors. In my simple form code, I use:

<%= f.error_notification %> 

This shows common errors, but not basic errors. How to view basic erros?

+5
source share
2 answers

Just add

  <%= f.error :base %> 

which will show the basic errors at the top of the form.

+10
source

error_notification accepts the message parameter if you want to override it using any basic error messages.

 <%= f.error_notification message: f.object.errors[:base].to_sentence %> 
+3
source

All Articles