How to specify devise_parameter_sanitizer for edit action?

Once again, it was a matter of reading the manual …

The magic word is :account_update and thus the working version becomes

def configure_permitted_parameters
  devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :password, :password_confirmation, :firstname, :middlename, :lastname, :nickname) }
  devise_parameter_sanitizer.for(:account_update) { |u| u.permit(:email, :password, :password_confirmation, :current_password, :firstname, :middlename, :lastname, :nickname) }
end

Note that if you’re in the business of signing in using non-standard parameters, the word you’re looking for is :sign_in (as expected).

Leave a Comment