简体   繁体   中英

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.

Did you try to add to ApplicationController?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM