'sortable_columns' is a clean and lightweight solution for making table columns sortable.
Ruby CoffeeScript
Switch branches/tags
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.rvmrc
CHANGELOG.md
Gemfile
LICENSE.txt
README.rdoc
Rakefile
config.ru
sortable_columns.gemspec

README.rdoc

sortable_columns

A clean and lightweight solution for making table columns sortable.

Install

Put this line in your Gemfile:

gem 'sortable_columns'

Then bundle:

% bundle

Usage

Column Sorter

Just instantiate the ColumnSorter object with the class to be sorted and pass the pertinent parameters to it.

sort = ColumnSorter.new(klass)
sort.column(params[:column])
sort.direction(params[:direction])

Views

Just call the sortable helper:

<%= sortable column_name %>

TODOs

  • This gem has zero testing coverage. SAD TROMBONE

  • ActiveRecord Scope Extension

Copyright

Copyright © 2012 Brian McNabb. See LICENSE.txt for further details.