diff options
author | Jody McIntyre <scjody@modernduck.com> | 2014-09-17 15:37:22 -0400 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-04-27 16:49:52 +0100 |
commit | 6a695ee68e002c47eb39d205e69b2e539be933bc (patch) | |
tree | 9346c61abc9dea8e8c94a51273a71c282b49c3ad /app/controllers/track_controller.rb | |
parent | 4b04aa47335edbe7ce9e64bd939da9fd8623eff0 (diff) |
Add controller for non-logged in "voting"
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r-- | app/controllers/track_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 4b272797f..708dd8737 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -214,6 +214,14 @@ class TrackController < ApplicationController redirect_to URI.parse(params[:r]).path 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 - |