How do you peek and poke the (starting) data in a form? I thought it would be in the @changeset
assign, but that seems to be an empty changeset until form submission.
I have a form for an application resource that has a one-to-many relationship with another record, and I am trying to use Drab to make the nested form dynamic, with add and remove buttons for this nested resource.
In more concrete terms to make this clearer (hopefully): the application is for managing a livestock auction-house. The main resource is “lots”, but the manager needs to detail each animal in a lot, so the lot schema has a has_many
relationship with the “animal” schema. I have managed to get a nested form working with a hard-coded number of animals, and I’m trying to use Drab to give the form add and remove buttons on the animal nested form. I just can’t figure out what you poke
when it comes to Ecto/Phoenix forms.