开发者

"Email is already taken" error when user logs in with client_side_validations and devise

开发者 https://www.devze.com 2023-03-20 17:40 出处:网络
I am trying to use both client_side_validati开发者_JAVA技巧ons and devise in my Rails app, and get a weird bug in the log in form.

I am trying to use both client_side_validati开发者_JAVA技巧ons 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消