mercredi 11 mars 2015

Rails Devise edit registration without password confirmation except for changing password

By default devise requires a current password confirmation in order to change user details.


By adding this code to my registration controller I can make it such this confirmation password is not needed:



protected

def update_resource(resource, params)
resource.update_without_password(params)
end


However, what I need is to change any information about profile (name, email, telephone etc.) without current password confirmation.


At the same time, in order to set a new password the old password should be required.


Aucun commentaire:

Enregistrer un commentaire