Skip to content

Error messages. #1

Description

@lcreid

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions