开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜