Allows you to create a sortable list from your ActiveRecord model, can use a belongs_to relationship to act as the scope.
Add this line to your application's Gemfile:
gem 'sortable_record'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sortable_record
Make a model sortable
class Book < ActiveRecord::Base
has_many :chapters
end
class Chapter < ActiveRecord::Base
include SortableRecord
is_sortable :position, :book
belongs_to :book
end
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request