Skip to content

A Ruby on Rails plugin for sorting active record collections

License

Notifications You must be signed in to change notification settings

jgill/sortable

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sortable
==============

History
==============

08/17/2010
Version: 0.0.3
 - Added update argument to ajax generated links
 - Added method to generated links

07/22/2010
Version: 0.0.2
 - Bug Fixes
 - Updated Documentation

04/13/2010
Version: 0.0.1
  - Initial release

Use this plugin to create links for sorting active record result sets.

Example
=======

In your model:

class User < ActiveRecord::Base
  sortable_columns [:first_name, :last_name, :age, :date_of_birth]
end

In your view:

<%= sort_link(:title => "First Name", :sort_column => :first_name, :sortable_type => :user) %>

In your controller:

@users = User.ordered(sort_order(:default => :age, :allowable_sorts => User.sorts, :sortable_type => :user))

Copyright (c) 2010 Nick DeSteffen, released under the MIT license

About

A Ruby on Rails plugin for sorting active record collections

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published