I built an app based on content provided by the Generator. I haven’t gotten around to understanding the form syntax. How do I tweak the below code so that when the user clicks the button the current action is performed and then a redirect to the homepage is performed? This is something I would typically do in JS .
<.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[:version]} type="text" label="Version" />
<.input field={f[:owner]} type="text" label="Owner" />
<.input field={f[:note]} type="textarea" label="Note" />
<.input field={f[:developer]} type="text" label="Developer" />
<.input field={f[:status]} type="text" label="Status" />
<.input field={f[:url]} type="text" label="Url" />
<.input field={f[:manager]} type="text" label="Manager" />
<.input field={f[:db_backup]} type="checkbox" label="DB Backup" />
<.input field={f[:vnetc_auto_upgrade]} type="checkbox" label="vNetC Auto Upgrade" />
<.input field={f[:firmware_auto_upgrade]} type="checkbox" label="Firmware Auto Upgrade" />
<.input field={f[:managed_out_of_service]} type="checkbox" label="Managed Out of Service" />
<:actions>
<.button>Save Test bed</.button>
</:actions>
</.simple_form>
I tried wrapping it with the link component and of course it didn’t work.
<:actions>
<.link href={~p"/"}>
<.button>Save Test bed</.button>
</.link>
</:actions>
Thank you
BTW I am looking to do it in a way where an extra button is added. I don’t want to change the abstraction so that it breaks the current behavior.
I could copy the controller info and that’s what I am doing now but at a glance I thought there might be a quicker way