1 # Filters added to this controller will be run for all controllers in
2 # the application. Likewise, all the methods added will be available
5 class ApplicationController < ActionController::Base
6 # add authentication methods and hooks
7 include AuthenticatedSystem
9 require_dependency "user"
11 # add sitealizer statistics and tracking information
14 before_filter :use_sitealizer, :add_stylesheets
19 # this is defined is a sketchy way in the sitealizer mixin
20 # initalize. since i'm overloading that, i'm calling it here
21 $visits = [] unless $visits
25 file = "#{Dir.pwd}/public/stylesheets/#{controller_name}.css"
27 @stylesheets << controller_name
31 #both election_controller and quickvote_controller need this method
33 @vote = Vote.find(params[:id])
35 @vote.rankings.each do |ranking|
36 ranking.rank = params['rankings-list'].index(ranking.candidate.id.to_s) + 1
39 render :nothing => true