Hi Everyone!
I have been getting into Elixir and most recently Phoenix. I am running into an issue though trying to build a website with Phoenix. I want to change one field in my changeset struct, which I am using put_change for, however, I get the error that is in the title. I am not really sure what I am doing wrong and have searched everywhere for the error.
I am sure its probably something simple I just can’t seem to figure it out. Thanks for your help and the code snippet is below!
def update(conn, %{"id" => id, "artist" => artistParams}) do
if upload = artistParams["img"] do
extension = Path.extname(upload.filename)
#temporary for dev
File.cp(upload.path, "redacted")
#artistParams = Artist.changeset(%Artist{},%{img: "/artistimg/"<>id<>"profile"<>extension})
end
artistParams = Ecto.Changeset.put_change(artistParams, :img, "test");
artist = Artists.getArtist(id)
Artists.updateArtist(artist,artistParams)
reRender(conn,0)
end