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 … Read more

Rails – Strong Parameters – Nested Objects

As odd as it sound when you want to permit nested attributes you do specify the attributes of nested object within an array. In your case it would be Update as suggested by @RafaelOliveira params.require(:measurement) .permit(:name, :groundtruth => [:type, :coordinates => []]) On the other hand if you want nested of multiple objects then you … Read more

how to permit an array with strong parameters

This https://github.com/rails/strong_parameters seems like the relevant section of the docs: The permitted scalar types are String, Symbol, NilClass, Numeric, TrueClass, FalseClass, Date, Time, DateTime, StringIO, IO, ActionDispatch::Http::UploadedFile and Rack::Test::UploadedFile. To declare that the value in params must be an array of permitted scalar values map the key to an empty array: params.permit(:id => []) In … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)