Hi folks. I’m trying to make a LiveView page which lets you edit a list of items. However I wasn’t sure what the best way to do that was in terms of how to handle the changesets, as there is no natural parent record in my case. A couple of options I’ve considered:
- Use an embedded schema that just has a
has_many
relationship toItem
, then useinputs_for
to iterate over the items to make the form. Mostly works well, except when doingRepo.insert(item_container)
I then get an error because you can’t insert a struct for an embedded schema. Feel there is probably a way around this but not sure the best approach - Use a map or a list of changesets with a form for each - doesn’t feel ideal!
Thoughts appreciated!