这是indexloc提供的服务,不要输入任何密码
Skip to content

cfabianski/sorted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sorted

Sorted is a simple object that will take an sql order string and a url sort string to let you sort large datasets over many pages (using will_paginate or kaminari) without loosing state.

<img src=“https://secure.travis-ci.org/mynameisrufus/sorted.png” />

Gemfile

gem 'sorted', '~> 0.4.2'

View

Generate a sorted link with the email attribute:

link_to_sorted "Email", :email

Model

Using the sorted method with the optional default order argument:

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

About

Sorting large datasets

Resources

License

Stars

Watchers

Forks

Packages

No packages published