Rails 3 - Devise“请输入电子邮件地址”弹出消息,即使可验证已禁用
我似乎无法删除注册过程中电子邮件地址无效时出现的烦人的弹出消息。
我正在使用 Devise,并且尝试删除 :validatable 但该消息仍然弹出。它必须是 javascript 或其他东西,因为页面不会重新加载,该消息只是出现在一个丑陋的粉红色框中。
该消息仅显示“请输入电子邮件地址”。
我在网络或 github 上找不到任何关于此问题的信息,也无法在 devise 应用程序中找到任何可能与此事件相关的代码。
有什么想法吗?
I cant seem to remove an annoying popup message which appears whenever an email address is invalid during the registration process.
I'm using Devise and I have tried removing :validatable but yet the message still pops up. Its must be javascript or something as the page doesn't reload, the message just appears in an ugly pink box.
The message simply reads " Please enter an email address ".
I cant find a single thing on the web or github about this issue, nor can I find any code in the devise app which might relate to this occurance.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可能是由于浏览器中内置的 html5 验证造成的。尝试将
novalidate="novalidate"
添加到您的表单标记中probably this is due to the html5 validation built in your browser. Try to add
novalidate="novalidate"
to your form tag设备视图在其视图中使用 email_field 。为了覆盖它,您需要在应用程序中生成设计视图并使用标准文本字段覆盖它们。
The devise view uses email_field in it's views. In order to override that, you need to generate the devise views into your app and override them with a standard text_field.
您还可以在视图中将字段类型从 email_field 更改为 text_field,这样就不会触发 html5 电子邮件验证。
You can also change the field type from email_field to text_field in the view and the html5 email validation won't be triggered.