AE
Ash Elixir•4mo ago
madhu

Getting protocol Phoenix.HTML.Safe not implemented with "Ash Phoenix"

Protocol.UndefinedError at GET /profile protocol Phoenix.HTML.Safe not implemented for type AshPhoenix.Form (a struct) Got value: #AshPhoenix.Form< resource: ObanDashboard.UserProfile, action: :create, type: :create, params: %{ user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3", firstname: "", lastname: "", timezone: "Etc/UTC" }, source: #Ash.Changeset< domain: ObanDashboard.Domain, action_type: :create, action: :create, attributes: %{timezone: "Etc/UTC"}, relationships: %{}, errors: [], data: %ObanDashboard.UserProfile{ user: #Ash.NotLoaded<:relationship, field: :user>, meta: #Ecto.Schema.Metadata<:built, "user_profiles">, id: nil, user_id: nil, firstname: nil, lastname: nil, timezone: "Etc/UTC", inserted_at: nil, updated_at: nil }, valid?: true >, name: "user_profile", data: nil, form_keys: [], forms: %{}, domain: ObanDashboard.Domain, method: "post", submit_errors: nil, id: "user_profile", transform_errors: nil, original_data: nil, transform_params: nil, prepare_params: nil, prepare_source: nil, raw_params: %{ user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3", firstname: "", lastname: "", timezone: "Etc/UTC" }, warn_on_unhandled_errors?: true, any_removed?: false, added?: false, changed?: false, touched_forms: MapSet.new([:user_id, :firstname, :lastname, :timezone]), valid?: true, errors: nil, submitted_once?: false, just_submitted?: false, ... >
32 Replies
Rebecca Le
Rebecca Le•4mo ago
what code is causing this error?
madhu
madhuOP•4mo ago
<.simple_form for={@phoenix_form} phx-submit="save"> <.input form={@phoenix_form} name="user_profile[email]" value={@user.email} field={:email} label="Email" readonly class="w-full px-3 py-2 border rounded bg-gray-100" /> <.input form={@phoenix_form} name="user_profile[firstname]" value={(@profile && @profile.firstname) ""} field={:firstname} label="First Name" class="w-full px-3 py-2 border rounded" /> <.input form={@phoenix_form} name="user_profile[lastname]" value={(@profile && @profile.lastname) ""} field={:lastname} label="Last Name" class="w-full px-3 py-2 border rounded" /> <.input form={@phoenix_form} name="user_profile[timezone]" value={(@profile && @profile.timezone) || ""} field={:timezone} type="select" options={@timezones} label="Timezone" class="w-full px-3 py-2 border rounded" /> <:actions> <.button class="mt-4 bg-indigo-600 text-white px-4 py-2 rounded"> Save </.button> </:actions> </.simple_form>
Rebecca Le
Rebecca Le•4mo ago
you're going to have to narrow it down, what line of code does the error point to?
madhu
madhuOP•4mo ago
defprotocol Phoenix.HTML.Safe do first line I am getting this error
Rebecca Le
Rebecca Le•4mo ago
can you paste the stacktrace from the error?
madhu
madhuOP•4mo ago
(phoenix_html 4.2.1) lib/phoenix_html/safe.ex:1: Phoenix.HTML.Safe.impl_for!/1 (phoenix_html 4.2.1) lib/phoenix_html/safe.ex:15: Phoenix.HTML.Safe.to_iodata/1 (phoenix_html 4.2.1) lib/phoenix_html.ex:244: Phoenix.HTML.build_attrs/1 (phoenix_html 4.2.1) lib/phoenix_html.ex:197: Phoenix.HTML.attributes_escape/1 (oban_dashboard 0.1.0) lib/oban_dashboard_web/components/core_components.ex:402: anonymous fn/2 in ObanDashboardWeb.CoreComponents."input (overridable 1)"/1 (oban_dashboard 0.1.0) /Users/amf-elixir-2025/oban_dashboard/lib/oban_dashboard_web/live/user_profile_live.ex:109: ObanDashboardWeb.UserProfileLive.render/1 (elixir 1.18.1) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:412: Phoenix.LiveView.Diff.traverse/7 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:555: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7 (elixir 1.18.1) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:412: Phoenix.LiveView.Diff.traverse/7 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:555: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7 (elixir 1.18.1) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:412: Phoenix.LiveView.Diff.traverse/7 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:555: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7 (elixir 1.18.1) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:412: Phoenix.LiveView.Diff.traverse/7 (phoenix_live_view 1.0.11) lib/phoenix_live_view/diff.ex:555: anonymous fn/4 in Phoenix.LiveView.Diff.traverse_dynamic/7
Rebecca Le
Rebecca Le•4mo ago
(oban_dashboard 0.1.0) lib/oban_dashboard_web/components/core_components.ex:402: anonymous fn/2 in ObanDashboardWeb.CoreComponents."input (overridable 1)"/1
(oban_dashboard 0.1.0) /Users/amf-elixir-2025/oban_dashboard/lib/oban_dashboard_web/live/user_profile_live.ex:109: ObanDashboardWeb.UserProfileLive.render/1
(oban_dashboard 0.1.0) lib/oban_dashboard_web/components/core_components.ex:402: anonymous fn/2 in ObanDashboardWeb.CoreComponents."input (overridable 1)"/1
(oban_dashboard 0.1.0) /Users/amf-elixir-2025/oban_dashboard/lib/oban_dashboard_web/live/user_profile_live.ex:109: ObanDashboardWeb.UserProfileLive.render/1
these lines - what's on those?
madhu
madhuOP•4mo ago
<.input form={@phoenix_form} name="user_profile[email]" value={@user.email} field={:email} label="Email" readonly class="w-full px-3 py-2 border rounded bg-gray-100" /> -- 109 core components - 402 "<input type={@type} name={@name} id={@id} value={Phoenix.HTML.Form.normalize_value(@type, @value)} class={[ "mt-2 block w-full rounded-lg text-zinc-900 focus:ring-0 sm:text-sm sm:leading-6", @errors == [] && "border-zinc-300 focus:border-zinc-400", @errors != [] && "border-rose-400 focus:border-rose-400" ]} {@rest} />"
Rebecca Le
Rebecca Le•4mo ago
odd. how have you defined your form? did you call to_form on it before rendering?
madhu
madhuOP•4mo ago
form = if profile do AshPhoenix.Form.for_update(profile, :update, as: "user_profile", api: ObanDashboard, forms: [auto?: true], params: params ) else AshPhoenix.Form.for_create(UserProfile, :create, as: "user_profile", api: ObanDashboard, forms: [auto?: true], params: params ) end # phoenix_form = AshPhoenix.FormData.to_form(form, as: "user_profile") phoenix_form = form case form.source.action_result do {:ok, profile} -> {:noreply, assign(socket, profile: profile, form: form, phoenix_form: phoenixform, success: true)} -> {:noreply, assign(socket, form: form, phoenix_form: phoenix_form, success: false)} end
Rebecca Le
Rebecca Le•4mo ago
thats a no - what's form.source.action_result?
madhu
madhuOP•4mo ago
I am. not able to render form at all application stuck
Rebecca Le
Rebecca Le•4mo ago
yes, you need to call to_form on the AshPhoenix.Form to make it compatible with Phoenix. I'd recommend reading through the docs at https://hexdocs.pm/ash_phoenix/AshPhoenix.Form.html to see how to work with forms
madhu
madhuOP•4mo ago
ok sure, thank you I am doing this "phoenix_form = AshPhoenix.FormData.to_form(form, as: "user_profile")" still same issue
Rebecca Le
Rebecca Le•4mo ago
to_form is a Phoenix function, not AshPhoenix.FormData
madhu
madhuOP•4mo ago
ok my dependency {:ash_phoenix, "~> 2.3"}, why I am not able do import AshPhoenix.FormComponents
Rebecca Le
Rebecca Le•4mo ago
because it doesn't exist where did you get that from?
madhu
madhuOP•4mo ago
key :name not found in: %{
id: nil,
label: "Email",
type: "text",
prompt: nil,
field: :email,
errors: [],
rest: %{
form: %Phoenix.HTML.Form{
source: #AshPhoenix.Form<
resource: ObanDashboard.UserProfile,
action: :create,
type: :create,
params: %{
user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3",
firstname: "",
lastname: "",
timezone: "Etc/UTC"
},
source: #Ash.Changeset<
domain: ObanDashboard.Domain,
action_type: :create,
action: :create,
attributes: %{timezone: "Etc/UTC"},
relationships: %{},
errors: [],
data: %ObanDashboard.UserProfile{
user: #Ash.NotLoaded<:relationship, field: :user>,
__meta__: #Ecto.Schema.Metadata<:built, "user_profiles">,
id: nil,
user_id: nil,
firstname: nil,
lastname: nil,
timezone: "Etc/UTC",
inserted_at: nil,
updated_at: nil
},
valid?: true
>,
name: "user_profile",
data: nil,
form_keys: [],
forms: %{},
domain: ObanDashboard.Domain,
method: "post",
submit_errors: nil,
id: "user_profile",
transform_errors: nil,
original_data: nil,
transform_params: nil,
prepare_params: nil,
prepare_source: nil,
raw_params: %{
user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3",
firstname: "",
lastname: "",
timezone: "Etc/UTC"
},
warn_on_unhandled_errors?: true,
any_removed?: false,
added?: false,
changed?: false,
touched_forms: MapSet.new([:user_id, :firstname, :lastname, :timezone]),
valid?: true,
errors: nil,
submitted_once?: false,
just_submitted?: false,
...
>,
impl: Phoenix.HTML.FormData.AshPhoenix.Form,
id: "user_profile",
name: "user_profile",
data: nil,
action: nil,
hidden: [
_touched: "user_id,firstname,lastname,timezone",
_form_type: "create"
],
params: %{
user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3",
firstname: "",
lastname: "",
timezone: "Etc/UTC"
},
errors: [],
options: [method: "post"],
index: nil
},
readonly: true,
class: "w-full px-3 py-2 border rounded bg-gray-100"
},
__changed__: nil,
multiple: false,
__given__: %{label: "Email", field: :email, __changed__: nil}
}
key :name not found in: %{
id: nil,
label: "Email",
type: "text",
prompt: nil,
field: :email,
errors: [],
rest: %{
form: %Phoenix.HTML.Form{
source: #AshPhoenix.Form<
resource: ObanDashboard.UserProfile,
action: :create,
type: :create,
params: %{
user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3",
firstname: "",
lastname: "",
timezone: "Etc/UTC"
},
source: #Ash.Changeset<
domain: ObanDashboard.Domain,
action_type: :create,
action: :create,
attributes: %{timezone: "Etc/UTC"},
relationships: %{},
errors: [],
data: %ObanDashboard.UserProfile{
user: #Ash.NotLoaded<:relationship, field: :user>,
__meta__: #Ecto.Schema.Metadata<:built, "user_profiles">,
id: nil,
user_id: nil,
firstname: nil,
lastname: nil,
timezone: "Etc/UTC",
inserted_at: nil,
updated_at: nil
},
valid?: true
>,
name: "user_profile",
data: nil,
form_keys: [],
forms: %{},
domain: ObanDashboard.Domain,
method: "post",
submit_errors: nil,
id: "user_profile",
transform_errors: nil,
original_data: nil,
transform_params: nil,
prepare_params: nil,
prepare_source: nil,
raw_params: %{
user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3",
firstname: "",
lastname: "",
timezone: "Etc/UTC"
},
warn_on_unhandled_errors?: true,
any_removed?: false,
added?: false,
changed?: false,
touched_forms: MapSet.new([:user_id, :firstname, :lastname, :timezone]),
valid?: true,
errors: nil,
submitted_once?: false,
just_submitted?: false,
...
>,
impl: Phoenix.HTML.FormData.AshPhoenix.Form,
id: "user_profile",
name: "user_profile",
data: nil,
action: nil,
hidden: [
_touched: "user_id,firstname,lastname,timezone",
_form_type: "create"
],
params: %{
user_id: "3b06a43b-d8af-4500-b5b9-fcbcb15168f3",
firstname: "",
lastname: "",
timezone: "Etc/UTC"
},
errors: [],
options: [method: "post"],
index: nil
},
readonly: true,
class: "w-full px-3 py-2 border rounded bg-gray-100"
},
__changed__: nil,
multiple: false,
__given__: %{label: "Email", field: :email, __changed__: nil}
}
I am getting this error not able to resolve
Rebecca Le
Rebecca Le•4mo ago
again, going to need more information
madhu
madhuOP•4mo ago
@impl true
def mount(_params, _session, socket) do
user = socket.assigns[:current_user]

query =
ObanDashboard.UserProfile
|> Ash.Query.filter(expr(user_id == ^user.id))

profile =
case Ash.read!(query, domain: ObanDashboard.Domain) do
[profile] -> profile
_ -> nil
end

form =
if profile do
AshPhoenix.Form.for_update(profile, :update,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true]
)
else
AshPhoenix.Form.for_create(UserProfile, :create,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: %{
user_id: user.id,
firstname: "",
lastname: "",
timezone: "Etc/UTC"
}
)
end

{:ok,
assign(socket,
form: form |> to_form(),
profile: profile,
user: user,
success: nil,
timezones: @timezones
)}
end
@impl true
def mount(_params, _session, socket) do
user = socket.assigns[:current_user]

query =
ObanDashboard.UserProfile
|> Ash.Query.filter(expr(user_id == ^user.id))

profile =
case Ash.read!(query, domain: ObanDashboard.Domain) do
[profile] -> profile
_ -> nil
end

form =
if profile do
AshPhoenix.Form.for_update(profile, :update,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true]
)
else
AshPhoenix.Form.for_create(UserProfile, :create,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: %{
user_id: user.id,
firstname: "",
lastname: "",
timezone: "Etc/UTC"
}
)
end

{:ok,
assign(socket,
form: form |> to_form(),
profile: profile,
user: user,
success: nil,
timezones: @timezones
)}
end
@impl true
def render(assigns) do
~H"""
<.simple_form for={@form} phx-submit="save">
<.input form={@form} field={:email} label="Email" readonly class="w-full px-3 py-2 border rounded bg-gray-100" />
<.input form={@form} field={:firstname} label="First Name" class="w-full px-3 py-2 border rounded" />
<.input form={@form} field={:lastname} label="Last Name" class="w-full px-3 py-2 border rounded" />
<.input
form={@form}
field={:timezone}
type="select"
options={@timezones}
label="Timezone"
class="w-full px-3 py-2 border rounded"
/>
<:actions>
<.button class="mt-4 bg-indigo-600 text-white px-4 py-2 rounded">
Save
</.button>
</:actions>
</.simple_form>
"""
end
@impl true
def render(assigns) do
~H"""
<.simple_form for={@form} phx-submit="save">
<.input form={@form} field={:email} label="Email" readonly class="w-full px-3 py-2 border rounded bg-gray-100" />
<.input form={@form} field={:firstname} label="First Name" class="w-full px-3 py-2 border rounded" />
<.input form={@form} field={:lastname} label="Last Name" class="w-full px-3 py-2 border rounded" />
<.input
form={@form}
field={:timezone}
type="select"
options={@timezones}
label="Timezone"
class="w-full px-3 py-2 border rounded"
/>
<:actions>
<.button class="mt-4 bg-indigo-600 text-white px-4 py-2 rounded">
Save
</.button>
</:actions>
</.simple_form>
"""
end
Rebecca Le
Rebecca Le•4mo ago
start from the error, and work backwards. what line of code is it pointing to, in your app's code?
madhu
madhuOP•4mo ago
<.input form={@form} field={:email} label="Email" readonly class="w-full px-3 py-2 border rounded bg-gray-100" /> this line, the email coming from ash_authentication user profile
Rebecca Le
Rebecca Le•4mo ago
compare that line to other forms in your app - do they do form fields the same way?
madhu
madhuOP•4mo ago
ok I am first time trying with ash phoenix form component, I am not getting clue my complete component as shown below
defmodule ObanDashboardWeb.UserProfileLive do
use ObanDashboardWeb, :live_view
alias ObanDashboard.UserProfile
alias ObanDashboard.Accounts.User
import Ash.Filter
import Ash.Expr
require Ash.Query

# import AshPhoenix.FormComponents

on_mount {ObanDashboardWeb.LiveUserAuth, :live_user_required}

@timezones [
"Etc/UTC",
"America/New_York",
"Europe/London",
"Asia/Kolkata",
"Asia/Tokyo",
"Australia/Sydney"
]

@impl true
def mount(_params, _session, socket) do
user = socket.assigns[:current_user]

query =
ObanDashboard.UserProfile
|> Ash.Query.filter(expr(user_id == ^user.id))

profile =
case Ash.read!(query, domain: ObanDashboard.Domain) do
[profile] -> profile
_ -> nil
end

form =
if profile do
AshPhoenix.Form.for_update(profile, :update,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true]
)
else
AshPhoenix.Form.for_create(UserProfile, :create,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: %{
user_id: user.id,
firstname: "",
lastname: "",
timezone: "Etc/UTC"
}
)
end

{:ok,
assign(socket,
form: form |> to_form(),
profile: profile,
user: user,
success: nil,
timezones: @timezones
)}
end

@impl true
def handle_event("save", %{"user_profile" => params}, socket) do
user = socket.assigns.user
profile = socket.assigns.profile

params = Map.put(params, "user_id", user.id)

form =
if profile do
AshPhoenix.Form.for_update(profile, :update,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: params
)
else
AshPhoenix.Form.for_create(UserProfile, :create,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: params
)
end

# Note: No to_form! Just assign :form
case form.source.action_result do
{:ok, profile} ->
{:noreply, assign(socket, profile: profile, form: form |> to_form(), success: true)}

_ ->
{:noreply, assign(socket, form: form |> to_form(), success: false)}
end
end

@impl true
def render(assigns) do
~H"""
<.simple_form for={@form} phx-submit="save">
<.input
form={@form}
field={:email}
label="Email"
readonly
value={(@profile && @profile.email) || @user.email}
class="w-full px-3 py-2 border rounded bg-gray-100"
/>
<.input
form={@form}
field={:firstname}
label="First Name"
class="w-full px-3 py-2 border rounded"
/>
<.input
form={@form}
field={:lastname}
label="Last Name"
class="w-full px-3 py-2 border rounded"
/>
<.input
form={@form}
field={:timezone}
type="select"
options={@timezones}
label="Timezone"
class="w-full px-3 py-2 border rounded"
/>
<:actions>
<.button class="mt-4 bg-indigo-600 text-white px-4 py-2 rounded">
Save
</.button>
</:actions>
</.simple_form>
"""
end
end
defmodule ObanDashboardWeb.UserProfileLive do
use ObanDashboardWeb, :live_view
alias ObanDashboard.UserProfile
alias ObanDashboard.Accounts.User
import Ash.Filter
import Ash.Expr
require Ash.Query

# import AshPhoenix.FormComponents

on_mount {ObanDashboardWeb.LiveUserAuth, :live_user_required}

@timezones [
"Etc/UTC",
"America/New_York",
"Europe/London",
"Asia/Kolkata",
"Asia/Tokyo",
"Australia/Sydney"
]

@impl true
def mount(_params, _session, socket) do
user = socket.assigns[:current_user]

query =
ObanDashboard.UserProfile
|> Ash.Query.filter(expr(user_id == ^user.id))

profile =
case Ash.read!(query, domain: ObanDashboard.Domain) do
[profile] -> profile
_ -> nil
end

form =
if profile do
AshPhoenix.Form.for_update(profile, :update,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true]
)
else
AshPhoenix.Form.for_create(UserProfile, :create,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: %{
user_id: user.id,
firstname: "",
lastname: "",
timezone: "Etc/UTC"
}
)
end

{:ok,
assign(socket,
form: form |> to_form(),
profile: profile,
user: user,
success: nil,
timezones: @timezones
)}
end

@impl true
def handle_event("save", %{"user_profile" => params}, socket) do
user = socket.assigns.user
profile = socket.assigns.profile

params = Map.put(params, "user_id", user.id)

form =
if profile do
AshPhoenix.Form.for_update(profile, :update,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: params
)
else
AshPhoenix.Form.for_create(UserProfile, :create,
as: "user_profile",
api: ObanDashboard,
forms: [auto?: true],
params: params
)
end

# Note: No to_form! Just assign :form
case form.source.action_result do
{:ok, profile} ->
{:noreply, assign(socket, profile: profile, form: form |> to_form(), success: true)}

_ ->
{:noreply, assign(socket, form: form |> to_form(), success: false)}
end
end

@impl true
def render(assigns) do
~H"""
<.simple_form for={@form} phx-submit="save">
<.input
form={@form}
field={:email}
label="Email"
readonly
value={(@profile && @profile.email) || @user.email}
class="w-full px-3 py-2 border rounded bg-gray-100"
/>
<.input
form={@form}
field={:firstname}
label="First Name"
class="w-full px-3 py-2 border rounded"
/>
<.input
form={@form}
field={:lastname}
label="Last Name"
class="w-full px-3 py-2 border rounded"
/>
<.input
form={@form}
field={:timezone}
type="select"
options={@timezones}
label="Timezone"
class="w-full px-3 py-2 border rounded"
/>
<:actions>
<.button class="mt-4 bg-indigo-600 text-white px-4 py-2 rounded">
Save
</.button>
</:actions>
</.simple_form>
"""
end
end
Rebecca Le
Rebecca Le•4mo ago
none of the issues so far have been related to AshPhoenix.Form - they've all been from Phoenix
madhu
madhuOP•4mo ago
ok
Rebecca Le
Rebecca Le•4mo ago
and this one is going to be around your input component, and the data it expects there will be examples of how to use it in the generated CoreComponents file, presuming you haven't edited the component
madhu
madhuOP•4mo ago
let me start from scratch with
sh <(curl 'https://ash-hq.org/install/virtual_reality_yoga?install=phoenix') \
&& cd virtual_reality_yoga && mix igniter.install ash ash_phoenix \
ash_postgres ash_authentication ash_authentication_phoenix ash_admin \
live_debugger mishka_chelekom --auth-strategy password \
--auth-strategy magic_link --yes && mix ash.setup
sh <(curl 'https://ash-hq.org/install/virtual_reality_yoga?install=phoenix') \
&& cd virtual_reality_yoga && mix igniter.install ash ash_phoenix \
ash_postgres ash_authentication ash_authentication_phoenix ash_admin \
live_debugger mishka_chelekom --auth-strategy password \
--auth-strategy magic_link --yes && mix ash.setup
Rebecca Le
Rebecca Le•4mo ago
restarting from scratch whenever you have to debug an issue isn't really a feasible strategy
ken-kost
ken-kost•4mo ago
I think you overriden your form here with old form that was not "to form". that's why the error, it's not "to form" form.
No description
ken-kost
ken-kost•4mo ago
🤔 now I see the first line is commented out also. I'm thinking it should be the other way around, or just phoenix_form = to_form(form, as: "user_profile") did you try that and it didn't work?
ZachDaniel
ZachDaniel•4mo ago
to_form() is definitely necessary

Did you find this page helpful?