X-Git-Url: https://projects.mako.cc/source/selectricity-live/blobdiff_plain/22f84a3ea8bc39eb4cb91575d35dfca683336032..79f6b7581f906943e7e016dfdc3dd8544583beb4:/app/controllers/quickvote_controller.rb diff --git a/app/controllers/quickvote_controller.rb b/app/controllers/quickvote_controller.rb index 61a4c69..c7e52d6 100644 --- a/app/controllers/quickvote_controller.rb +++ b/app/controllers/quickvote_controller.rb @@ -1,5 +1,5 @@ class QuickvoteController < ApplicationController - layout 'hc' + layout 'main' model :quick_voter model :quick_vote model :vote @@ -10,7 +10,6 @@ class QuickvoteController < ApplicationController ############################################################# def create - breakpoint if params[:quickvote] @quickvote = QuickVote.new(params[:quickvote]) @@ -106,11 +105,16 @@ class QuickvoteController < ApplicationController else # record the ip address for posterity - @voter.ipaddress = request.env["HTTP_X_FORWARDED_FOR"] + @voter.ipaddress = request.env["REMOTE_ADDR"] @voter.save - # toggle the confirmation bit + # save the time the vote was made for statistical use, it doesn't + #work here unless I use a method that will save it to the db + @voter.vote.time = Time.now + + # toggle the confirmation bit @voter.vote.confirm! + @voter.reload render :action => 'thanks' end