]> projects.mako.cc - selectricity-live/blobdiff - app/controllers/election_controller.rb
Added individual widgets for embeddable voting to images folder, aboutot start editing.
[selectricity-live] / app / controllers / election_controller.rb
index 6faaf22bd0f28548b407b1a4bc6a0e7d0a2b91ea..571b93628e7e916f2dd4e2228e91c02729c5344d 100644 (file)
@@ -76,6 +76,10 @@ class ElectionController < ApplicationController
                                         :locals => { :page => 'review' }
 
     @election = Election.find(params[:id])
                                         :locals => { :page => 'review' }
 
     @election = Election.find(params[:id])
+    if @election.type == QuickVote
+      redirect_to(:controller => 'quickvote', :action => 'index', :ident => @election.id)
+    end
+      
   end
 
   def start_election
   end
 
   def start_election
@@ -169,7 +173,7 @@ class ElectionController < ApplicationController
   def results
     @election = Election.find( params[:id] )
     votes = []
   def results
     @election = Election.find( params[:id] )
     votes = []
-
+    
     @election.voters.each do |voter|
       if voter.vote and voter.vote.confirmed?
         votes << voter.vote.rankings.sort.collect {|vote| vote.candidate_id}
     @election.voters.each do |voter|
       if voter.vote and voter.vote.confirmed?
         votes << voter.vote.rankings.sort.collect {|vote| vote.candidate_id}
@@ -182,6 +186,7 @@ class ElectionController < ApplicationController
     
     @candidates_by_id = {}
     @election.candidates.each {|cand| @candidates_by_id[cand.id] = cand}
     
     @candidates_by_id = {}
     @election.candidates.each {|cand| @candidates_by_id[cand.id] = cand}
+    
   end
   
   def detailed_results
   end
   
   def detailed_results
@@ -190,7 +195,8 @@ class ElectionController < ApplicationController
 
     @voter_list = []
     @vote_list = []
 
     @voter_list = []
     @vote_list = []
-    @election.voters. each do |voter|
+    
+    @election.voters.each do |voter|
       if voter.vote and voter.vote.confirmed?
         @voter_list << voter.email
              @vote_list << voter.vote
       if voter.vote and voter.vote.confirmed?
         @voter_list << voter.email
              @vote_list << voter.vote

Benjamin Mako Hill || Want to submit a patch?