Class: Admin::ResourceController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/generators/admin_interface/templates/setup/controllers/resource_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroy_allObject

inherited_resources options nested_belongs_to :user, :optional => true



9
10
11
12
13
# File 'lib/generators/admin_interface/templates/setup/controllers/resource_controller.rb', line 9

def destroy_all
  destroyed_resources = resource_class.destroy_all(:id => params[:ids])
  flash[:notice] = "#{destroyed_resources.size} objects destroyed."
  redirect_to :back
end