I've some time working with Rails but I have a problem and don't know how to solve.
There is a model X and a model YW and between them a joint model
I need to pass from view to controller as part of the parameters the X the x_yw_attributes but I don't know how stablish the correct way of the attribute name in html.
The idea will be this:
"x" => {
"name"=>"Name 1", "description"=>"Descripción 1", "status"=>"true",
"x_yw_attributes" =>[
{"yw_id"=>"15", "range"=>"[1,2,3,5]", "payment" => "[2,3,4,5,6,7]"},
{"yw_id"=>"17", "range"=>"[1000,2000,3000,5000]", "payment" => "[20,30,40,50,60,70]"},
{"yw_id"=>"19", "range"=>"[10000,20000,30000,50000]", "payment" => "[200,300,400,500,600,700]"}
],
"categories_ids"=>["", "2", "", "5", "5"]
}
I know how to do it with the categories for example:
<input type="checkbox" name="x[category_ids][]" value="2" checked="checked">
<label for="category_2">Category 2</label>
So let me know how should I write the name attribute or I you need more info. Thaks for the help.