Module: Component::CollectionTable::BatchActionsConcern

Extended by:
ActiveSupport::Concern
Included in:
Component::CollectionTable
Defined in:
app/concerns/component/collection_table/batch_actions_concern.rb

Instance Method Summary collapse

Instance Method Details

#batch_actions(options = {}, &block) ⇒ Object

Example:

= table.batch_actions(actions: { destroy: url_for(action: :destroy_many) })

9
10
11
12
13
14
# File 'app/concerns/component/collection_table/batch_actions_concern.rb', line 9

def batch_actions(options = {}, &block)
  @wrap_in_form = true
  title = @view.render partial: 'component/table/header_cells/batch_actions', locals: { options: options }
  options.reverse_merge!(render_as: :batch_actions, title: title)
  column(:batch_actions, options, &block)
end