aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/track_controller.rb
diff options
context:
space:
mode:
authorJody McIntyre <scjody@modernduck.com>2014-09-17 15:37:22 -0400
committerLouise Crow <louise.crow@gmail.com>2014-11-17 18:18:59 +0000
commit36030dabc5d5f24d7803a54fcd0030ba71ae44b6 (patch)
tree6b3baedfcc0dc45f9d31f275ea95b72a674cf5dd /app/controllers/track_controller.rb
parent367d9860fc03c08a5fb051e6b7df4f182399427d (diff)
Add controller for non-logged in "voting"
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r--app/controllers/track_controller.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb
index 83700a55b..8020c7b29 100644
--- a/app/controllers/track_controller.rb
+++ b/app/controllers/track_controller.rb
@@ -217,6 +217,14 @@ class TrackController < ApplicationController
redirect_to params[:r]
end
+ # Track interest in a request from a non-logged in user
+ def widget_vote
+ info_request = InfoRequest.find(params[:info_request_id])
+ if not @user and cookies[:widget_vote]
+ wv = info_request.widget_votes.where(:cookie => cookies[:widget_vote]).first_or_create
+ end
+ track_thing = TrackThing.create_track_for_request(info_request)
+ redirect_to do_track_path(track_thing), status => :temporary_redirect
+ end
end
-