Devise: Disable password confirmation during sign-up

后端 未结 9 1071
走了就别回头了
走了就别回头了 2020-12-24 01:13

I am using Devise for Rails. In the default registration process, Devise requires users to type the password twice for validation and authentication. How can I disable it?

9条回答
  •  無奈伤痛
    2020-12-24 02:06

    I am not familiar with Devise but if you have access to the model in the controller before save/validation could you do something like the following

    model.password_confirmation = model.password
    model.save
    

提交回复
热议问题