Skip to content

Devise error messasge do not shows proper #5530

@TangMonk

Description

@TangMonk

Fresh install Rails 7 and and devise 4.8.1

If I login in with wrong password, a flash error message will show up to page, like following screenshot:

enter image description here

But the weird thing is that flash error message is append to the end of html, like following screenshot:

enter image description here

the _error_message.html.erb is located in app/views/deivse/shared:

<% if resource.errors.any? %>
<div class="alert alert-primary" role="alert">
  <div id="error_explanation">
    <h2>
      <%= I18n.t("errors.messages.not_saved",
                 count: resource.errors.count,
                 resource: resource.class.model_name.human.downcase)
       %>
    </h2>
    <ul>
      <% resource.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
    </ul>
  </div>
</div>
<% end %>

I try to change above error view file, but the flash message still not change, even I empty the error view file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions