我无法弄清楚如何摆脱禁止此用户被保存的3错误:
我想要显示的只是子d中的错误.关于如何配合这个的任何想法?顺便说一下,我正在使用Devise.
I can’t figure out how to get rID of the 3 error prohibited this user
from being saved
我们覆盖了设计帮助器,使我们能够最终控制我们希望显示的错误. Here is a helpful resource向您展示了如何实现这一目标
–
帮手
根据Buck Doyle&的回答附加资源,您可能希望这样做:
#app/helpers/devise_helper.rbmodule DeviseHelper def devise_error_messages! resource.errors.full_messages.map { |msg| content_tag(:li,msg) }.join endend
这将允许您更改您的设计视图以包含devise_error_messages!方法:
#app/vIEws/devise/registrations/new.HTML.erb<%= devise_error_messages! %>总结
以上是内存溢出为你收集整理的html – 错误禁止此用户被保存:全部内容,希望文章能够帮你解决html – 错误禁止此用户被保存:所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)