@impl true
def render(assigns) do
~H"""
<div>
<.header>
<%= @title %>
<:subtitle>Use this form to manage customer records in your database.</:subtitle>
</.header>
<.simple_form
for={@form}
id="customer-form"
phx-target={@myself}
phx-change="validate"
phx-submit="save"
>
<.input field={@form[:version_id]} options={@versions} type="select" value={@form[:version_name]} label="Version" />
<.input field={@form[:name]} type="text" label="Name" />
<:actions>
<.button phx-disable-with="Saving...">Save Customer</.button>
</:actions>
</.simple_form>
</div>
"""
end
def mount(_params, _, socket) do
versions = for version <- Builder.list_version(), do: {version.id, version.name}
{:ok, assign(socket, :versions, versions)}
end
I get key :versions not found in: %{__changed__: %{action: true, customer: true, fla...
I was thinking that the mount could set the property versions for the render to use?