Rails 4 + Devise Login with email or username and strong parameters

前端 未结 1 1618
伪装坚强ぢ
伪装坚强ぢ 2021-02-03 10:43

I\'m new to RoR and stuck with this devise problem. I want to allow users to sign in with email OR username (registration with username is already ok).

I followed these

1条回答
  •  故里飘歌
    2021-02-03 11:36

    The problem is with the field "login", remove :authentication_keys => [:login] and add attr_accessor :login in your User model.

    0 讨论(0)
提交回复
热议问题