No commit activity in last 3 years
No release in over 3 years
Extends ActiveAdmin to provide a page on which to sort a model's instances.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Simple enough. You have a column in your model's table in which you'd like to hold the custom sorted order of the table's rows, and you'd like your ActiveRecord resource to provide a way to manage that column. This plugin defines an ActiveRecord dsl method to declare that attribute as the sort column.

sortable :position do
  column :title
end

where :position is the name of your custom order attribute. This method also declares collection_actions for your resource to manage drag-and-drop sorting of those rows. It uses jQuery UI Sortable plugin and will ajax the new sort order back to your app whenever the sort order is changed.

To use the index_as_grid mode, use this syntax:

sortable :position, :as => :grid do |resource|
  div resource.title
end

Usage:

gem 'activeadmin_sortable', '0.0.1.pre'