f4bae4287126e05488dbd76af1d11e2114ecdb33
[selectricity-live] / app / controllers / site_controller.rb
1 class SiteController < ApplicationController
2   layout 'vb'
3   model :user, :election
4
5   def index
6     if session[:user]
7       session[:user] = User.find(session[:user].id)
8       @current_elections = session[:user].elections.sort do |a,b|
9         b.enddate <=> a.enddate
10       end
11     end
12   end
13
14   def create_quickvote
15     if params[:quickvote] 
16       @quickvote = QuickVote.new(params[:quickvote])
17       if @quickvote.reviewed? and @quickvote.save
18           @quickvote = @quickvote.reload
19           render :action => 'success_quickvote'
20       end 
21     end
22   end
23
24 end

Benjamin Mako Hill || Want to submit a patch?