app/controllers/api/v1/accounts_controller.rb
# Only allow a list of trusted parameters through.
Only allow a list of trusted parameters through.
Only allow a list of trusted parameters through .
def account_params
    defaults = { customer_id: current_customer.id }
    meta_keys = params.require(:account).fetch(:meta, {}).keys
    params.require(:account).permit(:nick_name, meta: meta_keys).reverse_merge(defaults)
  end
def account_params defaults = { customer_id : current_customer . id } meta_keys = params . require ( :account ) . fetch ( :meta , { } ) . keys params . require ( :account ) . permit ( :nick_name , meta : meta_keys ) . reverse_merge ( defaults ) end
Only allow a list of trusted parameters through.
Only allow a list of trusted parameters through .