X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/469888b30ec666c4f5e11f0be42cab539b2a7ab4..d207da8dfc3f315f7758d1f5307c700ce4c25156:/app/controllers/site_controller.rb diff --git a/app/controllers/site_controller.rb b/app/controllers/site_controller.rb index 6e77b48..f4bae42 100644 --- a/app/controllers/site_controller.rb +++ b/app/controllers/site_controller.rb @@ -1,6 +1,24 @@ class SiteController < ApplicationController layout 'vb' + model :user, :election def index + if session[:user] + session[:user] = User.find(session[:user].id) + @current_elections = session[:user].elections.sort do |a,b| + b.enddate <=> a.enddate + end + end end + + def create_quickvote + if params[:quickvote] + @quickvote = QuickVote.new(params[:quickvote]) + if @quickvote.reviewed? and @quickvote.save + @quickvote = @quickvote.reload + render :action => 'success_quickvote' + end + end + end + end