Skip to content

Instantly share code, notes, and snippets.

@toraritte
Last active June 27, 2018 05:01
Show Gist options
  • Select an option

  • Save toraritte/7d968d8c1297ad5ea7bdf71ffeb0fbdb to your computer and use it in GitHub Desktop.

Select an option

Save toraritte/7d968d8c1297ad5ea7bdf71ffeb0fbdb to your computer and use it in GitHub Desktop.
Add IEx.pry to the `create` function in `user_controller.ex`
def create(conn, %{"user" => user_params}) do
# + + + + + + + + + + + +
require IEx; IEx.pry # <-
# + + + + + + + + + + + +
case Accounts.create_user(user_params) do
{:ok, user} ->
conn
|> put_flash(:info, "User created successfully.")
|> redirect(to: user_path(conn, :show, user))
{: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