Sha256: edb29e940e4ba875e1bc097b853cfca5266224d1d6f6f2c8380f9546f05ca684

Contents?: true

Size: 643 Bytes

Versions: 102

Compression:

Stored size: 643 Bytes

Contents

require 'active_support/concern'

module BulkDeleteConcern
  extend ActiveSupport::Concern
  included do
    # Should the action be visible
    # Edit By taris, it shows the button only if there are records displayed
    register_instance_option :visible? do
      # If not in index, then return true,
      # otherwise it wont' be added to the list
      # of all Actions during rails initialization
      # In index, instead, I show it only if there are records in the current view
      bindings[:controller].action_name == "index" ? (authorized? && !bindings[:controller].instance_variable_get("@objects").blank?) : true
    end
  end
end

Version data entries

102 entries across 102 versions & 2 rubygems

Version Path
thecore_ui_rails_admin-3.2.6 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.2.5 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.2.4 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.2.3 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.2.2 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.2.1 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.2.0 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.1.6 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.1.5 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.1.4 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.1.3 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.1.2 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.1.1 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.1.0 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.0.19 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.0.18 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.0.17 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.0.16 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.0.15 config/initializers/concern_bulk_delete.rb
thecore_ui_rails_admin-3.0.14 config/initializers/concern_bulk_delete.rb