Renamed "elections" controller to "election."
[selectricity-live] / app / views / election / _winner.rhtml
diff --git a/app/views/election/_winner.rhtml b/app/views/election/_winner.rhtml
new file mode 100644 (file)
index 0000000..531e0d2
--- /dev/null
@@ -0,0 +1,21 @@
+<% %>
+
+<% if @winners.length > 1 %>
+  <p>There were multiple winners for the election. The winners (tied)
+  were:
+
+  <ul>
+  <% for candidate in @winners %>
+    <li><%= @candidates_by_id[candidate].name %></li>
+  <% end %>
+  </ul>
+
+<% else %>
+
+  <% winner = @winners[0] %>
+  <p>The winner of the election was:
+     <strong><%= @candidates_by_id[winner].name %></strong>
+  </p>
+
+<% end %>
+

Benjamin Mako Hill || Want to submit a patch?