Module: ActiveAdmin::SortableTable::HandleColumn
- Defined in:
- lib/active_admin/sortable_table/handle_column.rb
Overview
Adds ‘handle_column` method to `TableFor` dsl.
Constant Summary collapse
- DEFAULT_OPTIONS =
{ move_to_top_url: ->(resource) { url_for([:move_to_top, :admin, resource]) }, move_to_top_handle: '⤒'.html_safe, show_move_to_top_handle: ->(resource) { !resource.first? }, sort_url: ->(resource) { url_for([:sort, :admin, resource]) }, sort_handle: '☰'.html_safe }
Instance Method Summary collapse
Instance Method Details
#handle_column(arguments = {}) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/active_admin/sortable_table/handle_column.rb', line 35 def handle_column(arguments = {}) = Uber::Options.new(DEFAULT_OPTIONS.merge(arguments)) column '', class: 'activeadmin_sortable_table' do |resource| = .evaluate(self, resource) sort_handle(, resource.send(resource.position_column)) + move_to_top_handle() end end |