Hello,
I have confused with the phoenix docs, hope someone here to answer my basic questions
So, If We have a migrated schema called players
with a column :name
, how we have to built a form with whom we can add data to this field :name
(string)? The point is that how do we call the function to record the data to the exactly this schema players
? I have tried (based on a different CRUD resource) creating a:
<%= form_for @changeset, @action, [multipart: true], fn f -> %>
<%= text_input f, :name %>
with
changeset = Home.change_players(%Players{})
and
def change_players(%Players{} = players, attrs \\ %{}) do
Players.changeset(players, attrs)
end
but obviously its not like that
Best Regards