X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/5459df3cc567b3fd1bd11e365c928fd6a16dc49e..fdf4d7a7c42462ffad099a04523d1494abcd226b:/app/controllers/application.rb diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 7a725ba..1387b29 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -49,7 +49,7 @@ class ApplicationController < ActionController::Base 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