1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Redirect to game on creation

This commit is contained in:
Daniel Barber 2016-12-09 16:38:05 +00:00
parent 7130e74516
commit 6291cbbff0

View File

@ -13,10 +13,10 @@ defmodule Chess.GameController do
changeset = Game.changeset(%Game{})
case Repo.insert(changeset) do
{:ok, _game} ->
{:ok, game} ->
conn
|> put_flash(:info, "Game created successfully.")
|> redirect(to: game_path(conn, :index))
|> redirect(to: game_path(conn, :show, game))
{:error, changeset} ->
render(conn, "new.html", changeset: changeset)
end