Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
'sortable_columns' is a clean and lightweight solution for making table columns sortable.
Ruby CoffeeScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

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.

Something went wrong with that request. Please try again.