Hello everybody
First of all, I hope it is allowed to ask questions about a specific book, yet since “Programming Phoenix” seems to be fairly widespread inside this circle, I’m bold enough to do so.
I tried to follow the guidelines and instructions in the book very closely, but now as I’m on page 65, I run into an - from my side - unexpected error which reads:
deps/ecto/lib/ecto/repo/queryable.ex:322: value "new"
in where
cannot be cast to type :id in query:
This is on http://localhost:4000/users/new
The error occurs after changing some of the code inside the user-controller.ex file. This is how my file looks like:
defmodule Rumbl.UserController do
use Rumbl.Web, :controller
def index(conn, _params) do
users = Repo.all(Rumbl.User)
render conn, "index.html", users: users
end
def show(conn, %{"id" => id}) do
user = Repo.get(Rumbl.User, id)
render conn, "show.html", user: user
end
alias Rumbl.User
def new(conn, _params) do
changeset = User.changeset(%User{})
render conn, "new.html", changeset: changeset
end
end
I’m not sure how informative this is to you.
Is there possibly something wrong with this code (I have checked it and it should be like instructed) or can you conclude the problem sitting at another place / another file?
Thank you.