Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def create(conn, %{"photo" => %{"image" => image_params} = photo_params}) do
upload(image_params)
case Images.create_photo(photo_params) do
{:ok, photo} ->
conn
|> put_flash(:info, "Photo created successfully.")
|> redirect(to: photo_path(conn, :show, photo))
{: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
You can’t perform that action at this time.