Current section

Files

Jump to
phoenix priv templates phoenix.gen.html index.html.eex
Raw

priv/templates/phoenix.gen.html/index.html.eex

<h2>Listing <%= template_plural %></h2>
<table class="table">
<thead>
<tr>
<%= for {k, _} <- attrs do %> <th><%= Phoenix.Naming.humanize(Atom.to_string(k)) %></th>
<% end %>
<th></th>
</tr>
</thead>
<tbody>
<%%= for <%= singular %> <- @<%= plural %> do %>
<tr>
<%= for {k, _} <- attrs do %> <td><%%= <%= singular %>.<%= k %> %></td>
<% end %>
<td class="text-right">
<span><%%= link "Show", to: <%= singular %>_path(@conn, :show, <%= singular %>), class: "btn btn-default btn-xs" %></span>
<span><%%= link "Edit", to: <%= singular %>_path(@conn, :edit, <%= singular %>), class: "btn btn-default btn-xs" %></span>
<span><%%= link "Delete", to: <%= singular %>_path(@conn, :delete, <%= singular %>), method: :delete, data: [confirm: "Are you sure?"], class: "btn btn-danger btn-xs" %></span>
</td>
</tr>
<%% end %>
</tbody>
</table>
<span><%%= link "New <%= template_singular %>", to: <%= singular %>_path(@conn, :new) %></span>