How do I read and track this phoenix error

I am going through the “Programming Phoenix 1.4” book and I am on page 51. When I place the code in template/index.html.eex I get the error listed in the image. The book doesn’t say that I would receive an error. I have no idea how to even begin to troubleshoot it.

The error occurs when I place the code below in In templates/user/index.html.eex

<h1>Listing Users</h1>

<table>
  <%= for user <- @users do %>
    <tr>
      <td><%= render "user.html", user: user %></td>
      <td><%= link "View", to: Routes.user_path(@conn, :show, user.id) %></td>
    </tr>
  <% end %>
</table>

I found the fix by referencing my code with the included code . I made a typo in the router.
The error output suggest that the issue is in the Router but if it wasn’t for the included code I would have never found my mistake.

I was suppose to have a router that looked like this:

  scope "/", RumblWeb do
    pipe_through :browser

    get "/users", UserController, :index
    get "/users/:id", UserController, :show
    get "/", PageController, :index
  end

and I forgot to set the :id in get "/users/:id", UserController, :show

1 Like