“电子邮件已经被占用”用户登录client_side_validations和devise时出错 [英] "Email is already taken" error when user logs in with client_side_validations and devise
问题描述
这是说电子邮件已经被取消,不允许用户登录:)
电子邮件用作登录。
只有当我设置:validate = >真的。
当我关闭设置:validate => true,登录成功执行。
可能会导致此问题?
我得到了client_side_validations的作者的答案:
对于登录表单,你不想有唯一性验证器。因此,您需要执行以下操作:
f.text_field:email,:validate => {:uniqueness => false}
由于我所理解的是由于在devise中进行条件验证的解决方法。 / p>
I am trying to use both client_side_validations and devise in my Rails app, and get a weird bug in the log in form.
It's says that the email has already been taken and doesn't let the user to log in :) Email is used as the login.
This is only when I set the :validate => true. When I turn off the setting :validate => true, the log in is performed successfully.
What might cause this problem?
I got the answer from the author of the client_side_validations:
For login form you don't want to have the uniqueness validator. So you'll need to do something like:
f.text_field :email, :validate => { :uniqueness => false }
From what I've understood this is the workaround because of the conditional validations in devise.
这篇关于“电子邮件已经被占用”用户登录client_side_validations和devise时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!