Add drag and drop sorting with ajax update to Active Admin Index Pages
Add this line to your application's Gemfile:
gem 'active_admin_sortable', :git => "git://github.com/krhorst/active_admin_sortable.git"
And then execute:
$ bundle
Or install it yourself as:
$ gem install active_admin_sortable
Then run the install generator to add the reference to the javascript for drag and drop
rails generate active_admin_sortable:install
Add the following line to your active admin resource:
active_admin_sortable
Your model should have an integer column to store the sort order of each item. By default it will look for a column named "sort", but you can use your own column name and pass it into the call to active_admin_sortable:
active_admin_sortable :sort_order
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request