Instantly share code, notes, and snippets.

Embed
What would you like to do?
def store(conn, file, album) do
case Images.create_photo(%{album_id: album, image: file}) do
{:ok, photo} ->
conn
|> put_flash(:info, "Photos created successfully.")
|> redirect(to: album_path(conn, :show, album))
{:error, %Ecto.Changeset{} = changeset} ->
render(conn, "new.html", changeset: changeset)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment