Sha256: 6538908101df7de38bcd1e7f85a5fd9256a3ec9a98c78c3bdad1c72bea6ac79f

Contents?: true

Size: 549 Bytes

Versions: 41

Compression:

Stored size: 549 Bytes

Contents

module Rao
  # Don't forget to add routes:
  #
  #     # config/routes.rb;
  #     resources :users do
  #       post :destroy_many, on: :collection
  #     end
  #
  module ResourcesController::BatchActionsConcern
    def destroy_many
      @collection = load_collection_scope.where(id: params[:ids])
      @collection.destroy_all

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

    private

    def after_destroy_many_location
      collection_path
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
rao-resources_controller-0.0.43.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.42.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.41.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.40.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.39.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.38.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.37.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.36.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.35.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.34.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.33.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.32.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.31.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.30.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.29.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.28.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.27.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.26.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.25.pre app/concerns/rao/resources_controller/batch_actions_concern.rb
rao-resources_controller-0.0.24.pre app/concerns/rao/resources_controller/batch_actions_concern.rb