diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/admin_user_controller.rb | 10 | ||||
-rw-r--r-- | app/views/admin_user/show.rhtml | 9 |
2 files changed, 17 insertions, 2 deletions
diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb index f9fe839df..ca69c87b9 100644 --- a/app/controllers/admin_user_controller.rb +++ b/app/controllers/admin_user_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: admin_user_controller.rb,v 1.6 2008-08-27 00:39:03 francis Exp $ +# $Id: admin_user_controller.rb,v 1.7 2008-09-15 11:11:13 francis Exp $ class AdminUserController < ApplicationController layout "admin" @@ -47,7 +47,13 @@ class AdminUserController < ApplicationController end end - + def destroy_track + track_thing = TrackThing.find(params[:track_id].to_i) + track_thing.destroy + flash[:notice] = 'Track destroyed' + redirect_to user_admin_url(track_thing.tracking_user) + end + private end diff --git a/app/views/admin_user/show.rhtml b/app/views/admin_user/show.rhtml index cf740edfa..fd6733db4 100644 --- a/app/views/admin_user/show.rhtml +++ b/app/views/admin_user/show.rhtml @@ -29,6 +29,7 @@ <th><%= column.human_name %></th> <% end %> <th>Items sent by email</th> + <th>Actions</th> </tr> <% for track_thing in @admin_user.track_things.find(:all, :order => 'created_at desc') %> @@ -38,6 +39,14 @@ <td><%=h track_thing.send(column) %></td> <% end %> <td><%= track_thing.track_things_sent_emails.size %></td> + <td> + <% form_tag '../destroy_track' do %> + <div> + <%= hidden_field_tag 'track_id', track_thing.id %> + <%= submit_tag "Destroy track" %> + </div> + <% end %> + </td> </tr> <% end %> </table> |