class ActiveAdmin::Views::IndexAsSortableTable
An index page component, which allows both list and tree reordering It has full interface-wise compatibility with IndexAsTable component Example usage:
index :as => :sortable_table, :tree => true
Public Instance Methods
build(page_presenter, collection)
click to toggle source
# File lib/activeadmin_draggable/sortable_tree.rb, line 11 def build(page_presenter, collection) table_options = { :id => active_admin_config.resource_name.plural, :sortable => false, :class => "index_table list", :i18n => active_admin_config.resource_class, :paginator => false } if is_tree = page_presenter.options[:tree] table_options[:class] += " tree" end table_for collection, table_options do |t| table_config_block = page_presenter.block || default_table instance_exec(t, &table_config_block) end end
table_for(*args, &block)
click to toggle source
# File lib/activeadmin_draggable/sortable_tree.rb, line 31 def table_for(*args, &block) insert_tag IndexSortableTableFor, *args, &block end