Hello! I write custom registration for different user types.
In addition to the fields of User on the form displays the Name field of Company model.
But when I press the submit button, I get an error "ArgumentError in RegistrationController#create"
Cannot build association character. Are you trying to build a polymorphic one-to-one association?
Application Trace | Framework Trace | Full Trace
app/controllers/registration_controller.rb:14:in `create'
Request
Parameters:
{"utf8"=>"✓",
"authenticity_token"=>"62bE9GNDQ1QFn5UDP34EmxLlHSRiKzCSPwJO8BiNuYU=",
"user"=>{"character_type"=>"Company",
"email"=>"",
"password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]",
"character_attributes"=>{"name"=>""}},
"commit"=>"Зарегистрироваться"}
How fix it? Thanks for your answers!