Trying to make HTML table using Ecto query

Hi, i’m trying to make a table on my website out of a simple ecto query that passes 3 fields -> id, name and cpf.

query = from r in School.Responsible, 
select: [,,r.cpf], 
responsible = School.Repo.all(query) 
render(conn, “new.html”,responsible: responsible)

However i’m still fairly new in this, and when i use this


it gives me the list but i can’t find how to separate it by rows like:
-> id1 name2 cpf2
->id2 name2 cpf2…

appreciate any help! thanks!

You will need to iterate over the results

  <%= for row <- @responsible do %>
      <%= for field <- row do %>
        <td><%= field %></td>
      <% end %>
  <% end %>

It worked perfectly, I hadn’t thought of it. Thanks!