Devise not displaying error messge during an authentication failure?

前端 未结 4 1740
名媛妹妹
名媛妹妹 2021-01-03 22:35

I was expecting a flash notice when authentication failures occurs in devise. But get nothing during a authentication failure, just the page refreshes and remains still. I

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-03 23:17

    Atlast after some good amount of searching/browsing I found the answer,
    you have to add the following piece of code in our application.html.erb file

      <%- flash.each do |name, msg| -%>
        <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %>
      <%- end -%>  
    

    After adding this I was able to see the sign_in failures alert messages :).

提交回复
热议问题