destroy member if password correct

This commit is contained in:
Brenda Wallace
2017-06-02 20:49:30 +12:00
parent 08996c4157
commit 75d2c0ea3c

View File

@@ -35,6 +35,14 @@ class RegistrationsController < Devise::RegistrationsController
render "edit"
end
end
def destroy
if @member.destroy_with_password(params.require(:member)[:current_password])
redirect_to root_path
else
render "edit"
end
end
end
# check if we need the current password to update fields