pinrails/app/views/machines/index.html.erb

25 lines
568 B
Plaintext

<h1>Pinball Machines</h1>
<table>
<thead>
<th>Name</th>
<th>Edition</th>
<th>Delete</th>
</thead>
<tbody>
<% @machines.each do |machine| %>
<tr>
<td><%= link_to machine.name, edit_machine_path(machine) %></td>
<td><%= machine.edition %></td>
<td><%= link_to "X", machine_path(machine),
method: :delete,
data: { confirm: "Are you sure?" } %></td>
</tr>
<% end %>
</tbody>
</table>
<hr>
<p><%= @machines.size %> available machines</p>
<%= link_to "+ Add Machine", new_machine_path %>