I wanted to debug Controllers in Phoenix the way i used to do with Rails by simply putting binding.pry
at any place i want to put a break point, So, i tried the same thing with Phoenix using IEx.pry
like below:-
defmodule Rumbl.UserController do
use Rumbl.Web, :controller
require IEx
def index(conn, _params) do
IEx.pry
users = Repo.all(Rumbl.User)
render conn, "index.html", users: users
end
end
But it's not putting any break point instead it's giving this message on console.
Cannot pry #PID<0.352.0> at web/controllers/users_controller.ex:6. Is an IEx shell running?
I also, tried running Iex shell by doing iex -S mix
but problem still continues. Did, i miss something or I am doing something wrong?
iex -S mix
? Did you passphoenix.server
as an argument too? Try withiex -S mix phoenix.server
. – Dogbertiex -S mix phoenix.server
. Are the results exactly the same? – coderVishal