diff options
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r-- | app/controllers/track_controller.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 7f0553a34..b37afc6d5 100644 --- a/app/controllers/track_controller.rb +++ b/app/controllers/track_controller.rb @@ -5,7 +5,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: track_controller.rb,v 1.17 2008-05-15 17:40:43 francis Exp $ +# $Id: track_controller.rb,v 1.18 2008-05-15 22:47:16 francis Exp $ class TrackController < ApplicationController @@ -95,6 +95,22 @@ class TrackController < ApplicationController end end + # Track a search term + def track_search_query + @query = params[:query] + @track_thing = TrackThing.create_track_for_search_query(@query) + ret = self.track_set + if ret + if @track_thing.track_medium == 'feed' + redirect_to :controller => 'track', :action => 'atom_feed', :track_id => @track_thing.id + else + flash[:notice] = "You are " + ret + " tracking the search '" + CGI.escapeHTML(@query) + "' !" + redirect_to user_url(@track_user) + end + end + end + + # Generic request tracker - set @track_thing before calling def track_set |