diff options
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 %> + |