diff options
Diffstat (limited to 'app/views/players/index.html.erb')
-rw-r--r-- | app/views/players/index.html.erb | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/app/views/players/index.html.erb b/app/views/players/index.html.erb index 7ad7944..aea4252 100644 --- a/app/views/players/index.html.erb +++ b/app/views/players/index.html.erb @@ -1,13 +1,25 @@ <h1>Pinball Players</h1> + +<table> + <thead> + <th>Name</th> + <th>Paid</th> + <th>Strikes</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> + </tr> + <% end %> + </tbody> +</table> + +<hr> <p><%= @players.size %> available players</p> -<ul> - <% @players.each do |player| %> - <li> - <%= link_to player.name, player %> - </li> - <% end %> -</ul> - -<%= link_to "Add player", new_player_path %> + +<%= link_to "+ Add player", new_player_path %> |