I'm working on a multi-model form and have ground to a complete halt.
I'm using a fields_for with an object_name of: project[team_props][][team_association_props][login_account_props][contact_mechanism_props]
The issue is that everything after the [team_association_props] is completely lost in the request parameters:
{"project"=>{"name"=>"",
"product_owner_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""},
"scrum_master_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""},
"team_props"=>[{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}},
{"team_association_props"=>{}}],
"description"=>""},
"__checkbox_scrumOfOne"=>"true",
"billing_account_id"=>"aMRblGKlCr3jLlabBlOzbT"}Now, if I do the following: project[team_props][#{index}][team_association_props][login_account_props][contact_mechanism_props]
Making the array into a Hash I get the following in the request:
{"project"=>{"name"=>"",
"product_owner_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""},
"scrum_master_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""},
"team_props"=>{"0"=>{"team_association_props"=>{"login_account_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""}}},
"1"=>{"team_association_props"=>{"login_account_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""}}},
"2"=>{"team_association_props"=>{"login_account_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""}}},
"3"=>{"team_association_props"=>{"login_account_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""}}},
"4"=>{"team_association_props"=>{"login_account_props"=>{"contact_mechanism_props"=>{"first_name"=>"",
"last_name"=>""},
"email_address"=>""}}}},
"description"=>""},
"__checkbox_scrumOfOne"=>"true",
"billing_account_id"=>"aMRblGKlCr3jLlabBlOzbT"}Like I would expect.
My question is am I just doing this wrong? Or is Rails deficient in this use case?
Thanks,
Mark