Created a partial to DRY the aja voting method. Modified the voter class to
[selectricity-live] / app / views / voter / _sortable_vote.rhtml
diff --git a/app/views/voter/_sortable_vote.rhtml b/app/views/voter/_sortable_vote.rhtml
new file mode 100644 (file)
index 0000000..4154482
--- /dev/null
@@ -0,0 +1,15 @@
+<% %>
+<div id="sortable_list">
+<ol id="rankings-list">
+  <% for ranking in @voter.vote.rankings %>
+    <li class="moveable" id="ranking_<%= ranking.candidate.id %>">
+      <%=h ranking.candidate.name.capitalize %></li>
+  <% end %>
+</ol>
+</div>
+
+<div class="clearbox"></div>
+
+<%= sortable_element 'rankings-list',
+    :url => { :action => "sort_candidates", :id => @voter.vote.id },
+    :complete => visual_effect(:highlight, 'rankings-list') %>
\ No newline at end of file

Benjamin Mako Hill || Want to submit a patch?