Skip to content

Tyralion/nested_set_natural_sort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NestedSetNaturalSort

Natural sorting for nested set

Installation

Add this line to your application's Gemfile:

gem 'nested_set_natural_sort'

And then execute:

$ bundle

Or install it yourself as:

$ gem install nested_set_natural_sort

Usage

Add in your model, after acts_as_nested_set

  class Catalog < ActiveRecord::Base

    acts_as_nested_set

    nested_set_natural_sort

    ...

By default, gem sort by field name. You cat change it

  class Catalog < ActiveRecord::Base

    acts_as_nested_set

    nested_set_natural_sort by_field: :title

    ...

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Tyralion/nested_set_natural_sort

License

Author: Tyralion ([email protected])

Copyright (c) 2016 Tyralion, released under the BSD license

About

Natural sorting for nested set

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages