We use the default behaviour of bootstrap_form to report errors, meaning that the errors are displayed "in line", in an area below the field that corresponds to the error. The views still have the call to devise_error_messages! in them, so errors are reported twice.
If we remove the call to devise_error_messages!, we still have to account for errors that might not correspond to a field. I believe the Rails documentation suggests that they should get a key of :base in the error collection (need to confirm this).
One solution would be to override devise_error_messages!, but I'm not a fan of magically overriding expected behaviour.
We could create a devise_bootstrap_form_error_messages! that output error messages for :base formatting consistently with the rest of the look and feel of the form.
Bonus marks if this method could detect if the form had the in-line option set, and produce the full set of messages if not. That would imply that the error message method would take the form builder as an argument.
We use the default behaviour of
bootstrap_formto report errors, meaning that the errors are displayed "in line", in an area below the field that corresponds to the error. The views still have the call todevise_error_messages!in them, so errors are reported twice.If we remove the call to
devise_error_messages!, we still have to account for errors that might not correspond to a field. I believe the Rails documentation suggests that they should get a key of:basein the error collection (need to confirm this).One solution would be to override
devise_error_messages!, but I'm not a fan of magically overriding expected behaviour.We could create a
devise_bootstrap_form_error_messages!that output error messages for:baseformatting consistently with the rest of the look and feel of the form.Bonus marks if this method could detect if the form had the in-line option set, and produce the full set of messages if not. That would imply that the error message method would take the form builder as an argument.