Skip to content
This repository has been archived by the owner on Jul 6, 2022. It is now read-only.
/ sorted-mongoid Public archive

For building data tables against Mongoid collections

License

Notifications You must be signed in to change notification settings

dleavitt/sorted-mongoid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sorted::Mongoid

Adds Mongoid support to sorted. Allows you to sort large (Mongoid) datasets over many pages, without losing state.

Installation

Add this line to your application's Gemfile:

gem 'sorted-mongoid'

And then execute:

$ bundle

Usage

Just like sorted, hopefully! Include it in your Gemfile and all your Mongoid models should have the sorted method, eg:

@users = User.sorted(params[:sort], "email ASC").page(params[:page])

Use SQL ordering keywords, even though we're not in SQLLand anymore.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

For building data tables against Mongoid collections

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages