Sha256: 6ef2eced41e33beca3c4dc1221a23f5024a25c32483a2c6d2784c01b3110c97a

Contents?: true

Size: 1.88 KB

Versions: 3

Compression:

Stored size: 1.88 KB

Contents

# MightyGrid [![Gem Version](http://img.shields.io/gem/v/mighty_grid.svg)](http://badge.fury.io/rb/mighty_grid) [![Build Status](https://travis-ci.org/jurrick/mighty_grid.svg?branch=master)](https://travis-ci.org/jurrick/mighty_grid) [![Code Climate](https://codeclimate.com/github/jurrick/mighty_grid.png)](https://codeclimate.com/github/jurrick/mighty_grid) [![Inline docs](http://inch-pages.github.io/github/jurrick/mighty_grid.png)](http://inch-pages.github.io/github/jurrick/mighty_grid)

MightyGrid is a flexible grid solution for Ruby On Rails.

## Installation

Add this line to your application's Gemfile:

    gem 'mighty_grid'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install mighty_grid

## Quick Start

### Controller

You can define class or relation in <tt>init_grid</tt> method.
```
def index
  @products_grid = init_grid(Product)
end
```

### Show View

```
<%= grid @products_grid do |g| %>
  <% - g.column :id %>
  <% - g.column :name %>
  <% - g.column :description %>
<% end %>
```

## Usage

### General configuration options

You can configure the following default values by overriding these values using <tt>MightyGrid.configure</tt> method.
```
per_page          # 15 by default
order_direction   # 'asc' by default
grid_name         # 'grid' by default
table_class       # '' by default
header_tr_class   # '' by default
pagination_theme  # 'mighty_grid' by default
```

There's a handy generator that generates the default configuration file into config/initializers directory.
Run the following generator command, then edit the generated file.

    $ rails g mighty_grid:install

## Contributing

1. Fork it ( http://github.com/jurrick/mighty_grid/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mighty_grid-0.3.3 README.md
mighty_grid-0.3.2 README.md
mighty_grid-0.3.1 README.md