Closed kaelumania closed 3 years ago
Hi @kaelumania! Sorry for the silence 😔 It would be nice to have and example app to see the whole code, but two low handing fruits first:
accepts_nested_attributes_for :treatments
in the Order
model?accepts_nested_attributes_for
)Closing the issue for now, please let me know if you need any assistance
Hello,
I am trying to create a form where my models can be created in a nested fashion as well as multiple at once.
Here is my code:
With this setup, I get the following error:
StoreModel::Types::CastError Exception: failed casting {"18"=>{"approach"=>"NONE"}, "17"=>{"approach"=>"PKM"}, "16"=>{"approach"=>"NONE"}}, only String or Array instances are allowed
I feel that my form does feel very nice, as I have to iterate over the teeth instances. But otherwise it does not work either, as the fields for helper does not detect the array.