I cant see what im missing. I have and Order with nested Items, these Items each have a Kind. I want to manipulate the kind_id param from each Item but the "f[:kind_id]" always return 0.
@order.items.each do |f|
f[:kind_id] = Kind.find_by_name(f[:kind_id]).id
end
the params i get is
{"authenticity_token"=>"7wz7ARjwcVvCR/bpp/T04JQIQwHsMKDflF1eMCL8PTU=",
"order"=>{"items_attributes"=>{"1271160144889"=>{"price"=>"2",
"amount"=>"2",
"text"=>"2",
"kind_id"=>"fds",
"_destroy"=>""}},
"total_price"=>"4"}}
The above params is of course test data :)