Skip to content

Instantly share code, notes, and snippets.

@breim
Created December 1, 2014 11:59
Show Gist options
  • Select an option

  • Save breim/ed440965858a8372b685 to your computer and use it in GitHub Desktop.

Select an option

Save breim/ed440965858a8372b685 to your computer and use it in GitHub Desktop.
Não preicsa digitar senha novamente no devise para alterar cadastro
# Esque esqueminha, ele não precisa digitar a senha atual para alterar o cadastro.
def update_with_password(params={})
if params[:password].blank?
params.delete(:password)
params.delete(:password_confirmation) if params[:password_confirmation].blank?
end
update_attributes(params)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment