Sha256: a189db027558fd4c41b3429db56612385ed6f469de16e13436deeb5fcc32e1b0

Contents?: true

Size: 365 Bytes

Versions: 2

Compression:

Stored size: 365 Bytes

Contents

module ResourcesController
  module BatchActionsConcern
    def destroy_many
      @collection = load_collection_scope.where(id: params[:ids])
      @collection.destroy_all

      respond_with @collection, location: after_destroy_many_location, noticse: t('.success')
    end

    private

    def after_destroy_many_location
      collection_path
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rails-add_ons-2.2.1 app/concerns/resources_controller/batch_actions_concern.rb
rails-add_ons-2.2.0 app/concerns/resources_controller/batch_actions_concern.rb