I am working with Rails 5
I aded new field username in model User.
class Users::RegistrationsController < Devise::RegistrationsController before
If you just change the .for to .permit it works as well. For example:
.for
.permit
devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit({ roles: [] }, :email, :password, :password_confirmation, :username) }
It works in both Rails 4.2.x and Rails 5.0.x