Toshiya Matsumoto
Toshiya Matsumoto

Reputation: 3

Unpermitted parameter ActiveAdmin Devise Rails

I both added username on signup page form and added the same name table column on MySQL database, however, when I click the sign up button, the error message appears and it's never inserted into the table: the rest of the data, email and password, is inserted properly.

Here is the error message:

Unpermitted parameter: :username

NOTE: username data is surely transmitted as POST parameter.

Although I've tried a lot, such as adding permit_params on controller etc, they've never worked well.

Any help or hint is appreciated.

My brief environment is below.

ruby 2.4.1p11 Rails 5.1.6 ActiveAdmin 1.3 Devise 4.4.3

Thank you.

Upvotes: 0

Views: 306

Answers (1)

Vasilisa
Vasilisa

Reputation: 4640

Did you try to add to ApplicationController?

def configure_permitted_parameters
  devise_parameter_sanitizer.permit(:sign_up, keys: [:username])
end

Upvotes: 1

Related Questions