MagicGrid ========= © 2011-2013 Ryan Graham, Dennis Taylor [![Gem Version](https://badge.fury.io/rb/magic_grid.png)](http://badge.fury.io/rb/magic_grid) [![Build Status](https://travis-ci.org/rmg/magic_grid.png?branch=master)](https://travis-ci.org/rmg/magic_grid) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/rmg/magic_grid) Easy collection display grid with column sorting and pagination. [MagicGrid Live Demo](http://magic-grid.herokuapp.com/) (it's not very pretty. [Help?](https://github.com/rmg/magic_grid-demo)) Displays a collection (ActiveRelation or Array) wrapped in an html table with server side column sorting, filtering hooks, and search bar. Large collections can be paginated with either the will_paginate gem or kaminari gem if you use them, or a naive Enumerable based paginator (without pager links) if neither is present. Tables are styled using Themeroller compatible classes, which also don't look _too_ bad with Bootstrap. Basic Usage ----------- In your `Gemfile`: gem 'magic_grid' In your controller: @posts = Post.where(:published => true) In your view: <%= magic_grid(@posts, [:title, :author]) %> What you'll get is an table with 2 sortable columns. You'll also get pagination if you have eitehr Keminari or WillPaginate loaded. You can also do your own row rendering by passing a block: ```rhtml <%= magic_grid(@posts, [:title, :author, "Actions"]) do |post| %>