Skip to content

Instantly share code, notes, and snippets.

@nhooyr
Created May 13, 2017 21:27

Revisions

  1. nhooyr created this gist May 13, 2017.
    8 changes: 8 additions & 0 deletions user_controller.ex
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    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