<%= @vote.title %>
<%= @vote.description %>
Organizers
<% @vote.organizers.each do |organizer| %>
- <%= organizer.user.email %>
<% end %>
All ratings
| Participant |
<% @vote.candidates.each do |candidate| %>
<%= candidate.name %> |
<% end %>
<% @vote.ratings.collect { |rating| rating.user }.uniq.each do |user| %>
| <%= user.email %> |
<% @vote.candidates.each do |candidate| %>
<% if rating = @vote.ratings.find { |rating| rating.user == user and rating.candidate == candidate } %>
<%= rating.value %> |
<% end %>
<% end %>
<% end %>
Results
<% @vote.candidates.sort { |a, b| a.mj <=> b.mj }.reverse.each do |candidate| %>
- <%= candidate.name %>: <%= candidate.mj.mj %>
<% end %>