The original code below was created with the HTML generator when I created TestBed table. The first field is referencing a field named "name" on TestBed. The second field I manually placed (the field with [:group]) in an attempt to reference the table data that TestBed belongs_to.
`<.simple_form :let={f} for={@changeset} action={@action}>
<.error :if={@changeset.action}>
Oops, something went wrong! Please check the errors below.
</.error>
<.input field={f[:name]} type="text" label="Name" />
<.input field={f[:group]} type="text" label="Group" />
<:actions>
<.button>Save Test bed</.button>
</:actions>
</.simple_form>`
In the field with the :group atom what I really want is the group name. In code that looks like this:
tb = App.TestBeds.get_test_bed!(1) tb.group.name
It just so happens if I write it like this it does not work as atoms do not have keys:
<.input field={f[:group.name]} type="text" label="Group" />
Is there a syntax that lets me capture the data I want using this form? Something like:
<.input field={f[:group],[:name]} type="text" label="Group" />
The error is attached. The only place I've seen that error before is when I referenced this data without preload, but as far as I can tell I am using preload in App.TestBeds.list_testbeds. I tried looking at the simple_form definition and docs but it's just too much for me to understand at this stage.
Thanks