From e7df11018ea1e15f8671f948126632be3ac86e84 Mon Sep 17 00:00:00 2001 From: Date: Thu, 30 Aug 2007 19:07:41 -0400 Subject: [PATCH] Started modifying the results page for final appearnces. --- app/models/election.rb | 2 +- app/views/quickvote/results.rhtml | 4 ++-- config/environment.rb | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/models/election.rb b/app/models/election.rb index 9c6337f..7fa138e 100644 --- a/app/models/election.rb +++ b/app/models/election.rb @@ -23,7 +23,7 @@ class Election < ActiveRecord::Base def other_methods if election_method - @other_methods = ELECTION_TYPES.reject {|i| i == election_method} + @other_methods = ELECTION_TYPES.keys.reject {|i| i == election_method} else @other_methods = nil end diff --git a/app/views/quickvote/results.rhtml b/app/views/quickvote/results.rhtml index eb149f6..a51ca1d 100644 --- a/app/views/quickvote/results.rhtml +++ b/app/views/quickvote/results.rhtml @@ -30,8 +30,8 @@
Winner - The chosen method is: - <%= @election.election_method.capitalize %> + Computed with + <%= ELECTION_TYPES[@election.election_method] %>
diff --git a/config/environment.rb b/config/environment.rb index 49b0c48..5ea9f10 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -67,7 +67,11 @@ require 'gruff-0.2.8/lib/gruff' require 'sparklines' require 'rubyvote' -ELECTION_TYPES = %w(ssd plurality approval condorcet borda) +ELECTION_TYPES = {'ssd' => "Schulze Sequential Dropping", + 'plurality' => "Plurality/First Past the Post", + 'approval' => "Approval (Top Two)", + 'condorcet' => "Simple Condorcet", + 'borda' => "Borda Count"} class String # alternate capitalization method that does not lowercase the rest of -- 2.30.2