我有一个名为公司的序列化表格
$("#company_form").serialize();
post请求中的参数看起来应该
company[name] company name
现在我需要将另一个序列化表单附加到公司 JSON 对象。到目前为止,我尝试以user form
相同的方式序列化并添加它
company.user = user
它附加了它,但参数没有序列化,它们看起来像
name name=name&email=test%40test.com
反而
user[email] test@test.com
user[name] name
如果请求在日志文件中成功,我应该会看到类似
{"company"=>{"name"=>"Hahn-Orn",
"tagline"=>"transform dynamic supply-chains",
"bio"=>["Tenetur non ex aliquam et. Autem velit consequatur et ea aut quos debitis. Nulla quia impedit deserunt nesciunt. Dolores ipsam quod dolores id maiores. Atque iste quis nihil velit.", "Ducimus soluta omnis facilis illum nihil aspernatur. Aut quasi qui libero et sed. Fuga nesciunt dolorem.", "Ducimus itaque harum. Dolor officia labore rerum ullam. Veniam omnis et aut excepturi ut."]},
"user"=>{"name"=>"Isabelle Schuster",
"email"=>"jonathan_smith@example.com",
"password"=>"[FILTERED]",
"password_confirmation"=>"[FILTERED]"}}