The problem exactly matches your problem: # 2574: devise_parameter_sanitizer.for (: sign_up) <<: something is causing an error .
In fact, the method of adding custom fields to strong parameters is a new feature included with Devise 3.1.
Since the current version in Rubygems.org is 3.0.3 , you cannot use this method in your rails project. You will have to override the default values:
devise_parameter_sanitizer.for(:sign_up) do |u| u.permit :email, :password, :password_confirmation, :first_name, :last_name end
But if you really need to, you can edit your Gemfile and replace this line
gem 'devise', '3.0.3'
with this:
gem 'devise', github: 'plataformatec/devise', branch: 'master'
Then you can easily add your custom fields:
# Single field devise_parameter_sanitizer.for(:account_update) << :first_name # Multiple fields at a time devise_parameter_sanitizer.for(:account_update) << [:first_name, :last_name]
But it will be warned , currently it is Release Candidate : 3.1.0 RC1
source share