]> projects.mako.cc - selectricity/blob - app/views/quickvote/_defeats_list.rhtml
Fix validation of candidate names
[selectricity] / app / views / quickvote / _defeats_list.rhtml
1 <% victories, tied =@election.condorcet_result.list_defeats -%>
2 <%candidates = @election.candidates.sort.collect {|candidate| candidate.id}%>
3 <% names = Hash.new -%>
4 <% candidates.each do |candidate| -%>
5         <%names[candidate] = Candidate.find(candidate).name -%>
6 <% end -%>
7
8 <% victories.each do |victory| -%>
9 <%= names[victory[0]] %> beat <%= names[victory[1]] %> by <%= victory[2]%> 
10 votes.<br />
11 <% end -%>
12
13 <% tied.each do |tie| -%>
14 <%= names[tie[0]]%> tied with <%= names[tie[1]]%><br />
15 <% end -%>

Benjamin Mako Hill || Want to submit a patch?