升级到设计3.5后,我在控制器中有这个:
class MyController < Devise::RegistrationsController
before_filter :configure_permitted_parameters
protected
def configure_permitted_parameters
devise_parameter_sanitizer.for(:user) { |u|
u.permit(:email, :password, :password_confirmation)
}
end
我仍然有错误“电子邮件不能为空,密码不能为空”等。在“params”的帖子中我有:
> params
=> {"utf8"=>"✓",
"authenticity_token"=>"fdsfdsfd",
"user"=>
{"first_name"=>"fdsf",
"last_name"=>"fdsf",
"email"=>"something@gmail.com",
"password"=>"fdsfdsfdsfds",
"var1"=>{"var11"=>"33243", "var12"=>"7"},
"var2"=>{"var21"=>"fdsfds", "var22"=>"3243243",},
"var3"=>"fdsfsfds",
"accept_terms"=>"1"},
"commit"=>"Sign Up",
"controller"=>"my",
"action"=>"create"}
为什么错误呢?