Sha256: c42c0834934fca802761e3187a03efca47a0810f32e6ca51ad9532a0de1f9dea

Contents?: true

Size: 481 Bytes

Versions: 3

Compression:

Stored size: 481 Bytes

Contents

module Component
  module CollectionTable::ActsAsListConcern
    extend ActiveSupport::Concern

    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
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails-add_ons-3.0.0.pre1 app/concerns/component/collection_table/acts_as_list_concern.rb
rails-add_ons-2.2.1 app/concerns/component/collection_table/acts_as_list_concern.rb
rails-add_ons-2.2.0 app/concerns/component/collection_table/acts_as_list_concern.rb