diff options
author | francis <francis> | 2008-05-12 10:57:43 +0000 |
---|---|---|
committer | francis <francis> | 2008-05-12 10:57:43 +0000 |
commit | 23147aefa11d95482af5dfa24458d8b1267026b0 (patch) | |
tree | 3fd32424039c174f1b2ccccc451d89183f41768b /app/controllers/track_controller.rb | |
parent | f4a292e1b94bad33af6140330151d6e13886ae58 (diff) |
Track requests by a particular user.
Diffstat (limited to 'app/controllers/track_controller.rb')
-rw-r--r-- | app/controllers/track_controller.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/app/controllers/track_controller.rb b/app/controllers/track_controller.rb index 970b2a52a..cd459d83e 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.14 2008-05-12 10:21:34 francis Exp $ +# $Id: track_controller.rb,v 1.15 2008-05-12 10:57:43 francis Exp $ class TrackController < ApplicationController @@ -68,6 +68,21 @@ class TrackController < ApplicationController end end + # Track a user + def track_user + @track_user = User.find_by_url_name(params[:url_name]) + @track_thing = TrackThing.create_track_for_user(@track_user) + 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 this person!" + redirect_to user_url(@track_user) + end + end + end + # Generic request tracker - set @track_thing before calling def track_set |