I have a relationship User has_one Profile. In my User
defmodule Cal.Accounts.User do
actions do
defaults [:read]
create :create_user_with_profile do
argument :profile, :map do
allow_nil? false
end
change manage_relationship(:profile, type: :create)
end
action
relationship do
has_one :profile, Cal.Accounts.Profile do
destination_attribute :user_profile_id
end
end
...
end
In my form liveview
def mount(_params, _session, socket) do
form = Cal.Accounts.form_to_create_user_with_profile()
socket =
socket
|> assign(:form, to_form(form))
|> assign(:page_title, "New User with Profile")
{:ok, socket}
end
def render(assigns) do
...
<h4>User</h4>
<.input field={form[:email]} label="Email" />
<.input field={form[:user_name]} label="Name" />
<.input field={form[:timezone]} label="Timezone" />
<h4>User Profile</h4>
<.inputs_for :let={form_profile} field={@form[:profile]}>
<.input field={form_profile[:title]} label="Title" />
<.input field={form_profile[:location]} label="Location" />
</.inputs_for>
end
The form renders the Email, Name and Timezone but the fields for profile Title and Location are not


















