about summary refs log tree commit diff
path: root/app/views/players/index.html.erb
blob: 31a84f1f1a5841f772d19309ab97f97b4611d1d6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<h1>Pinball Players</h1>

<table>
  <thead>
    <th>Name</th>
    <th>Paid</th>
    <th>Strikes</th>
    <th>Delete</th>
  </thead>
  <tbody>
    <% @players.order("strikes").each do |player| %>
      <tr>
        <td><%= link_to player.name, edit_player_path(player) %></td>
        <td><% if player.paid %>✓<% end %></td>
        <td><%= player.strikes %></td>
        <td><%= link_to "X", player_path(player),
          method: :delete,
          data: { confirm: "Are you sure?" } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<hr>
<p><%= @players.size %> available players</p>

<%= link_to "+ Add player", new_player_path %>