Module: Component::CollectionTable::ActsAsListConcern

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

Instance Method Summary collapse

Instance Method Details

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


5
6
7
8
9
10
11
12
13
14
# File 'app/concerns/component/collection_table/acts_as_list_concern.rb', line 5

def acts_as_list_actions(options = {}, &block)
  options.reverse_merge!(render_as: :acts_as_list, title: t('.column_titles.acts_as_list'), scope: nil)

  scope = options.delete(:scope)
  scope = "#{scope}_id".intern if scope.is_a?(Symbol) && scope.to_s !~ /_id$/

  options.merge(scope: scope)

  column(:acts_as_list_actions, options, &block)
end