X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/04f827dd4647f3a7d6e5bd8f5e9083c730a8dccc..3096416bbb8fdc92d7619aecc8237a57532d9066:/app/controllers/quickvote_controller.rb?ds=sidebyside diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index c3510f6..c16755a 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -1,5 +1,5 @@ class QuickvoteController < ApplicationController - layout 'vb' + layout 'hc' model :quick_voter model :vote model :election @@ -11,7 +11,7 @@ class QuickvoteController < ApplicationController session.session_id, @election.id])[0] unless @voter @voter = QuickVoter.new - @voter.election = Election.find_all( [ "name = ?", params[:votename] ] )[0] + @voter.election = QuickVote.find_all( [ "name = ?", params[:votename] ] )[0] end end @@ -42,6 +42,7 @@ class QuickvoteController < ApplicationController @voter = QuickVoter.new() @voter.election = election @voter.session_id = session.session_id + @voter.ipaddress = request.env["REMOTE_ADDR"] @voter.save @voter.reload @@ -53,7 +54,7 @@ class QuickvoteController < ApplicationController end def results - @election = Election.find_all( ["name = ?", params[:votename]] )[0] + @election = QuickVote.find_all( ["name = ?", params[:votename]] )[0] preference_tally = [] plurality_tally = []