我的应用程序出现此错误。
我正在使用 gem'activeadmin',github:'activeadmin',gem'trail','4.1.7'
即使所有列出的属性都包含在我的Active Admin Model上的强参数中。
ActiveAdmin.register User do
permit_params = :prefix, :firstname, :lastname, :password, :email, :membership_code, :birthdate, :contact_number, :location, :active, :confirmed, :remember_token, :town, :province
Request
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"xVA04SdSTDLrwC088FCTRm9fr62z+fgs6wJc0yNn/NU=",
"user"=>{"prefix"=>"mzxklmcklzmklMAKMDAKLSDMASKLDM",
"firstname"=>"KLMSDKMSADKLAMS",
"lastname"=>"MKDSMFKSLDMFK",
"password"=>"[FILTERED]",
"email"=>"KLMFDKDSMFKLSDMFKL",
"membership_code"=>"MKDFSMKLSDMFK",
"birthdate(1i)"=>"2009",
"birthdate(2i)"=>"2",
"birthdate(3i)"=>"1",
"contact_number"=>";WE,
LA;SD,
",
"location"=>",
LDSF,
LSDF,
SL;",
"active"=>"1",
"confirmed"=>"1",
"remember_token"=>"DSL;FSDFL",
"town"=>"FDMSKLFM",
"province"=>"FMSDFLKS"},
"commit"=>"Create User"}
任何帮助?
起初,我认为这是导致错误的生日(它包含3个参数,而不是1) 但我也有一个不同的资源,其中也有生日,它实际上有效。
答案 0 :(得分:0)
我在permit_params宣言上写了一个错字。我刚删除了等号。
permit_params = :prefix, :firstname, :lastname, :password, :email, :membership_code, :birthdate, :contact_number, :location, :active, :confirmed, :remember_token, :town, :province
permit_params :prefix, :firstname, :lastname, :password, :email, :membership_code, :birthdate, :contact_number, :location, :active, :confirmed, :remember_token, :town, :province
谢谢! @nistvan