Project

easytable

0.0
No commit activity in last 3 years
No release in over 3 years
adds helper methods to generate simple table
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Gem add the ability quickly create table render_table_for. Using in your helpers or views.

== Installation

1 Add this line to your application's Gemfile:

gem 'easytable'

2 And then execute:

$ bundle

== When to use it

If you too lazy to work with content tags or you hate a lot of html in your views, you can use just one line to generate simple table.

== Usage Examples

render_table_for(columns: [['Bob', 'bob@email.com'], ['Ben', 'ben@email.com']])

or

render_table_for(header: ['First name', 'Last name'], columns: @columns)

or

render_table_for(header: [:id, :email], columns: User.last(10))

or

render_table_for(columns: User.last(10))

Also you can specify table class name and id, using class and id:

render_table_for(header: [], columns: [], class: 'custom-class', id: 'table_id')

default class name is easy-table

== Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request