mardi 10 mars 2015

Rails Devise - Allow user to edit their account without CURRENT password

I am using Devise and want to allow a user to edit their account without their current_password. I still want the password and password_confirmation present, just not the current_password.


I've read the Devise wiki where you can update_without_password, but haven't been able to find anything on how to only update_without_current_password.


Any ideas?



class Users::RegistrationsController < Devise::RegistrationsController
def configure_account_update_params
devise_parameter_sanitizer.for(:account_update) << [:first_name, :last_name, :email, :locale, :time_zone, :phone, :password, :password_confirmation]
end
end

Aucun commentaire:

Enregistrer un commentaire