diff options
author | Ben Harris <ben@tilde.team> | 2021-08-22 22:27:41 -0400 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2021-08-22 22:27:41 -0400 |
commit | 9a2d1bbf9c07506b4de3b34788111e7c30fb262c (patch) | |
tree | a60dd97918b0561d25814d02c1cefdd51aba2827 /app/views/pages | |
parent | 4cc1a2f9dc215f91e969269002496b611d933e32 (diff) |
create team picker
Diffstat (limited to 'app/views/pages')
-rw-r--r-- | app/views/pages/index.html.erb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/views/pages/index.html.erb b/app/views/pages/index.html.erb index bccab8f..e53eece 100644 --- a/app/views/pages/index.html.erb +++ b/app/views/pages/index.html.erb @@ -1,3 +1,31 @@ <h1>nomi pinball</h1> <%= image_tag "coinslotlogo.png" %> +<table> + <thead> + <th>Name</th> + <th>Paid</th> + <th>Strikes</th> + </thead> + <tbody> + <% @players.order("strikes").each do |player| %> + <tr> + <td><%= player.name %></td> + <td><%= player.paid %></td> + <td><%= player.strikes %></td> + </tr> + <% end %> + </tbody> +</table> + +<h2>teampicker</h2> + +<% @players.order(Arel.sql("RANDOM()")).each_slice(@players.count % 4 == 0 ? 4 : 3).each.with_index(1) do |slice, i| %> + <h3>Team <%= i %></h3> + <ul> + <% slice.each do |player| %> + <li><%= player.name %></li> + <% end %> + </ul> +<% end %> + |