简体   繁体   English

设计devise_error_messages! 出现没有任何事件

[英]Devise devise_error_messages! shows up without any event

I have a devise_helper.rb file where I have: 我有一个devise_helper.rb文件,其中:

module DeviseHelper
  def devise_error_messages!
    'Looks like you missing a password'
  end
end

But whenever I go to /user/sign_up , it shows up. 但是每当我转到/user/sign_up ,它就会显示出来。 I wonder why that's still showing up without an action? 我不知道为什么没有采取行动仍然会出现这种情况?

Take a look at the devise helper file 看一下设计助手文件

devise_error_messages! devise_error_messages! is just a stub. 只是一个存根。 You need to override it with your own implementation of the error messages you want or copy the views to your app and change them to your preference. 您需要使用自己的所需错误消息实现来覆盖它,或者将视图复制到您的应用程序并将其更改为您的首选项。 It looks like you are just printing out 'Looks like you missing a password' the way you have it now. 看起来您像现在那样只是在打印“看起来像您丢失了密码”。 Hope this helps point you in the right direction. 希望这可以帮助您指出正确的方向。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM