1 class VoterController < ApplicationController
3 require_dependency "voter"
4 require_dependency "vote"
5 require_dependency "election"
9 password = params[:vote][:password] if params[:vote]
10 if @voter = FullVoter.find(:all, :conditions => [ "password = ?", password ] )[0]
11 @voter.vote = Vote.new if @voter.vote.nil?
12 @voter.vote.set_defaults! if @voter.vote.rankings.empty?
13 render :action => 'full_vote'
19 @voter.vote.time = Time.now
23 redirect_to :action => 'index'
30 render :action => 'thanks'
32 redirect_to :action => 'index'
38 password = params[:id]
39 @voter = FullVoter.find(:all, :conditions => [ "password = ?", password ] )[0]