X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/6a935d078f20d2b1b0d60f0a30c41a642d40758a..a48ffbac5ce1517a369ef84426bfe44d6ebad7cb:/app/controllers/application.rb?ds=inline diff --git a/app/controllers/application.rb b/app/controllers/application.rb index d8b2560..1387b29 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -47,8 +47,9 @@ class ApplicationController < ActionController::Base #both election_controller and quickvote_controller need this method def sort_candidates + @vote = Vote.find(params[:id]) - + @vote.rankings.each do |ranking| ranking.rank = params['rankings-list'].index(ranking.candidate.id.to_s) + 1 ranking.save