Created
July 7, 2018 01:03
-
-
Save rbnpercy/d5b75b67b9ff3634e15648393dbe7747 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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