Skip to content

Instantly share code, notes, and snippets.

@janjiss
Created December 14, 2015 13:26
Show Gist options
  • Select an option

  • Save janjiss/8ac30033d8a1699e9196 to your computer and use it in GitHub Desktop.

Select an option

Save janjiss/8ac30033d8a1699e9196 to your computer and use it in GitHub Desktop.
def register(conn, %{"user" => user_params}) do
case ElixirStream.RegisterAction.sign_up(user_params) do
{:ok, user} ->
conn
|> put_flash(:info, "You have signed up and logged in!")
|> put_session(:user_id, user.id)
|> redirect(to: entry_path(conn, :index))
{:error, changeset} ->
conn
|> render("register_form.html", changeset: changeset)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment