Nested Forms, has_many

I’m trying to test turbo-frame/stimulus with a CRUD order/items scenario.
I have an order with many items, in the ‘past’ we could use the cocoon gem to add new items. If I’m not mistaken it holds a hidden item form html, and whenever the user adds a new item it basically creates new elements copying this item form. It has some limitations but works.

I’m expecting hotwire to bring a new approach for cases like that, maybe a fresh and different way of thinking…
Would you guys use hotwire to add/edit/delete new items ? should/could I go to the back end to bring the item form ? or adding the form with stimulus fits better?

I haven’t came up with any idea ( maybe one or two ), so if you guys have some thoughts on that, it would be greate

1 Like
1 Like

I was wondering the same thing. A way to do that with just appending an “item” partial in the form without JS would be awesome. I’ll look into that @jonathanbruno !

1 Like