Skip to content

Instantly share code, notes, and snippets.

@nhooyr
Created May 13, 2017 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhooyr/a7c628d76d872744b5a5f62baf9af7f6 to your computer and use it in GitHub Desktop.
Save nhooyr/a7c628d76d872744b5a5f62baf9af7f6 to your computer and use it in GitHub Desktop.
def delete(conn, %{"id" => id}) do
user = Accounts.get_user!(id)
{:ok, _user} = Accounts.delete_user(user)
conn
|> put_flash(:info, "User deleted successfully.")
|> redirect(to: user_path(conn, :index))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment