#Give registered users additional QuickVote functionality
@quickvote.user_id = session[:user][:id] if session[:user]
+ @quickvote.create_candidates
# try to save, if it fails, show the page again (the flash should
# still be intact
# if the person has specified an election, we show them the voting
# page. otherwise, we redirect back to main the page
if @election
+
+ # if the election is over, redirect to the the results page
+ unless @election.active?
+ redirect_to quickaction_url(:ident => params[:ident],
+ :action => 'results')
+ end
+
# look to see that the voter has been created and has voted in
# this election, and has confirmed their vote
@voter = QuickVoter.find(:all,