Socket
Book a DemoInstallSign in
Socket

table_go

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

table_go

0.2.6
bundlerRubygems
Version published
Maintainers
2
Created
Source

TableGo

simple, flexible and fast html table generator

Installation

Add this line to your application's Gemfile:

gem 'table_go'

And then execute:

$ bundle

Or install it yourself as:

$ gem install table_go

Usage

example in HAML (or more here: http://table-go-example.exsemt.de/)

= table_go_for @orders, Order, :title => 'one Table',
    :table_html => { :id => :the_table },
    :row_html   => { :class => lambda { cycle('even', 'odd') },
                     :id => lambda { |record| dom_id(record, :special) }} do |t|

  - t.column :id,
             :column_html => { :class => lambda { |record, column, value| value.even? ? :even : :odd } }

  - t.column :my_type,
             :send => :titleize

  - t.column :vat,
             :label => 'as percent',
             :as => :percent

  - t.column :price,
             :label => 'as € currency',
             :as => :currency

  - t.column :date_of_order,
             :header_html => { :class => :date, :style => :xyz, :id => :date_column },
             :column_html => { :class => :date,
                               :style => :xyz,
                               :id => lambda { |record, column, value| "date_#{record.id}" }}

  - t.column :date_of_order,
             :as => :date,
             :as_options => { :format => :short }

  - t.column :date_of_order,
             :label  => 'with custom formatter',
             :as => lambda { |value, record, column| value.to_s.reverse }

  - t.column :date_of_order,
             :label => 'with block level custom formatter' do |value, record, column|
        %b do it
        %br
        = value
        %b like u want


  - t.column :xmas_bonus,
             :as => :boolean,
             :label => 'as boolean'

  - t.column :customer,
             :method => :name

TODO:

  • add sorting for column

Changelog

0.2.6

  • bugfixing

0.2.5

  • fixed generate csv bug

0.2.4

  • new method: table_rows_for
  • table options: render_rows_only, without_header

0.2.3

  • speed optimisation for haml templates
  • allowing block style table options

0.2.2

  • small fixes
  • tests

0.2.1

  • tests

0.2.0

  • allow multiline block level customization of columns

0.1.9

  • simple, flexible and fast html table generator

Contributing

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

FAQs

Package last updated on 16 Dec 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.