Why is devise not displaying authentication errors on sign in page?

前端 未结 4 1278
花落未央
花落未央 2020-12-29 14:41

I\'m using rails 4.2

I have a helper file called devise_helper.rb

module DeviseHelper
    def devise_error_messages!
        return \"\" if resource         


        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-29 14:51

    When you ran devise:install (or something similar), it must have created views with some specific line of codes to display these messages.

    If you look at this link, they explain that you can add <%= devise_error_messages! %> in your views to display those error messages (which isn't really different from having a generic <% flash.each {...} %> somewhere in your HTML...)

    Most likely, the views related to sessions do not contain this line of code.

提交回复
热议问题