From 5266239f66247c9f5a391ab6569a8fb8021279d8 Mon Sep 17 00:00:00 2001 From: Alban Peignier Date: Tue, 29 May 2012 08:58:06 +0200 Subject: Manage multiple selection to destroy several lines. Refs #25 --- app/controllers/lines_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/controllers') diff --git a/app/controllers/lines_controller.rb b/app/controllers/lines_controller.rb index 42a126169..e14baf211 100644 --- a/app/controllers/lines_controller.rb +++ b/app/controllers/lines_controller.rb @@ -12,6 +12,13 @@ class LinesController < ChouetteController show! end + def destroy_all + objects = + get_collection_ivar || set_collection_ivar(end_of_association_chain.where(:id => params[:ids])) + objects.destroy_all + respond_with(objects, :location => smart_collection_url) + end + protected def collection -- cgit v1.2.3