module ActiveAdmin::Reorderable::TableMethods

Public Instance Methods

reorder_column() click to toggle source
# File lib/active_admin/reorderable/table_methods.rb, line 5
def reorder_column
  column '', :class => 'reorder-handle-col' do |resource|
    reorder_handle_for(resource)
  end
end

Private Instance Methods

reorder_handle_content() click to toggle source
# File lib/active_admin/reorderable/table_methods.rb, line 22
def reorder_handle_content
  '≡≡'.html_safe
end
reorder_handle_for(resource) click to toggle source
# File lib/active_admin/reorderable/table_methods.rb, line 13
def reorder_handle_for(resource)
  aa_resource   = active_admin_namespace.resource_for(resource.class)
  instance_name = aa_resource.resources_configuration[:self][:route_instance_name]

  url = send([:reorder, aa_resource.route_prefix, instance_name, :path].join('_'), resource)

  span(reorder_handle_content, :class => 'reorder-handle', 'data-reorder-url' => url, 'data-reorder-id' => resource.id)
end