Add sortable columns for active admin.
Add member actions with one method call
Add sorting columns in your index views with one method call.
Integrates with acts_as_list
You need active_admin and acts_as_list.
Add it to your gemfile:
Install your bundle:
> bundle install
Assuming you have a Players model:
class Player < ActiveRecord::Base # acts as list acts_as_list default_scope :order => 'position ASC' #... end
You can add sortable columns, member actions and sorting like this:
#app/admin/players.rb ActiveAdmin.register Player do # Sort players by position config.sort_order = 'position' # Add member actions for positioning. sortable_member_actions index do # This adds columns for moving up, down, top and bottom. sortable_columns #... column :firstname column :lastname default_actions end end
Tests, tests, tests.
This project rocks and uses MIT-LICENSE.