summaryrefslogtreecommitdiff
path: root/app/views/tournaments/standings.html.erb
blob: 28d3c2224adda27941e5f6fec46c1f3a3806b400 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<% playerscores = @tournament.players.collect {|player| player => tournament.statistics.getStatistic(player.matches.last, player, :score) } %>

<table>
	<tr>
		<td>Standings:</td>
		<% place = 0 %>
		<% playerscores.sort {|player1, player2| playerscores[player1] <=> playerscores[player2] }.each |player| %>
			<td><%= place.to_s + ":" %> <%= player.user_name %></td>
			<% place += 1%>
		<% end %>
	</tr>
</table>