]> projects.mako.cc - selectricity/blob - app/controllers/voter_controller.rb
2ceb42b1d24d0db5af7550569bf48fdd5bf5c23e
[selectricity] / app / controllers / voter_controller.rb
1 class VoterController < ApplicationController
2   model :voter
3   model :vote
4   model :election
5
6   def index
7     password = params[:id]
8     @voter = Voter.find_all( [ "password = ?", password ] )[0]
9   end
10   
11   def review
12     password = params[:id]
13     @voter = Voter.find_all( [ "password = ?", password ] )[0]
14     
15     # destroy the old vote if that's what we need to do
16     @voter.vote.destroy if @voter.vote 
17     @voter.reload
18
19     @voter.vote = Vote.new
20     @voter.vote.votestring = params[:vote][:votestring] 
21     @voter.vote.save
22     render_text "success"
23   end
24
25 end

Benjamin Mako Hill || Want to submit a patch?