View the Project on GitHub codn/adminpanel
To let drag and drop to records of a model, on that model’s index page (to add sort option to the model gallery see SortableGallery).
You need to:
include Adminpanel::Sortable
concern in the model you want to make sortable.position
(integer) database attribute to that model.After that, your model is going to come sorted every time when you search and you’ll have icons to update the position of the model in the models index inside the panel.
This also add the scope ordered
to the model to get your objects sorted in your views.