Currently the component looks like this:
<div>
<.form :let={f} for={@changeset} phx-submit="save" phx-target={@myself} id={@id}>
<.input field={{f, :user_id}} type="hidden" />
<.input field={{f, :product_id}} type="hidden" />
<.input
field={{f, :stars}}
type="rating"
prompt="Rating"
options={[
"★★★★★": 5,
"★★★★": 4,
"★★★": 3,
"★★": 2,
"★": 1
]}
/>
<.button phx-disable-with="Saving...">Save</.button>
</.form>
</div>
However this gives me the following error:
Long error inside
key :name not found in: %{__changed__: nil, __given__: %{__changed__: nil, field: {%Phoenix.HTML.Form{source: #Ecto.Changeset, valid?: false>, impl: Phoenix.HTML.FormData.Ecto.Changeset, id: "rating-form-1", name: "rating", data: %Pento.Survey.Rating{__meta__: #Ecto.Schema.Metadata<:built, "ratings">, id: nil, stars: nil, user_id: 1, user: #Ecto.Association.NotLoaded, product_id: 1, product: #Ecto.Association.NotLoaded, inserted_at: nil, updated_at: nil}, hidden: [], params: %{}, errors: [], options: [method: "post", id: "rating-form-1", multipart: false, "phx-submit": "save", "phx-target": %Phoenix.LiveComponent.CID{cid: 1}], index: nil, action: nil}, :user_id}, type: "hidden"}, errors: [], field: {%Phoenix.HTML.Form{source: #Ecto.Changeset, valid?: false>, impl: Phoenix.HTML.FormData.Ecto.Changeset, id: "rating-form-1", name: "rating", data: %Pento.Survey.Rating{__meta__: #Ecto.Schema.Metadata<:built, "ratings">, id: nil, stars: nil, user_id: 1, user: #Ecto.Association.NotLoaded, product_id: 1, product: #Ecto.Association.NotLoaded, inserted_at: nil, updated_at: nil}, hidden: [], params: %{}, errors: [], options: [method: "post", id: "rating-form-1", multipart: false, "phx-submit": "save", "phx-target": %Phoenix.LiveComponent.CID{cid: 1}], index: nil, action: nil}, :user_id}, id: nil, inner_block: [], label: nil, multiple: false, prompt: nil, rest: %{}, type: "hidden"}What do I do to fix this?