X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/6a935d078f20d2b1b0d60f0a30c41a642d40758a..ad088c1324d08a65f6f5336bedf7a88a8a8950e7:/app/controllers/quickvote_controller.rb diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index f7ad5ff..c32d585 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -17,6 +17,7 @@ # . class QuickvoteController < ApplicationController + helper :sparklines layout 'main' require_dependency "quick_voter" require_dependency "quick_vote" @@ -94,7 +95,7 @@ class QuickvoteController < ApplicationController end end flash.keep(:candidate_names) - render_partial 'candidate_list' + render :partial => 'candidate_list' end ############################################################# @@ -138,6 +139,7 @@ class QuickvoteController < ApplicationController end def confirm + # we need the election to verify that we have the right voter election = QuickVote.ident_to_quickvote(params[:ident]) @@ -145,7 +147,7 @@ class QuickvoteController < ApplicationController @voter = QuickVoter.find(:all, :conditions => ["session_id = ? and election_id = ?", session.session_id, election.id])[0] - + if not @voter # we have not seen this voter before. something is wrong, try # again @@ -157,13 +159,11 @@ class QuickvoteController < ApplicationController redirect_to quickvote_url( :ident => params[:ident] ) else + # record the ip address for posterity @voter.ipaddress = request.env["REMOTE_ADDR"] @voter.save - # save the time the vote was made for statistical use - @voter.vote.time = Time.now - # toggle the confirmation bit @voter.vote.confirm!