Devise: Disable password confirmation during sign-up

后端 未结 9 1031
走了就别回头了
走了就别回头了 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 01:47

    See wiki

    def update_with_password(params={})
      params.delete(:current_password)
      self.update_without_password(params)
    end
    

    https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-edit-their-account-without-providing-a-password

提交回复
热议问题