RubyGems Navigation menu

table_display 2.0.0

Adds support for displaying your ActiveRecord tables, named scopes, collections, or plain arrays in a table view when working in rails console, shell, or email template. Enumerable#to_table_display returns the printable strings; Object#pt calls #to_table_display on its first argument and puts out the result. Columns you haven't loaded (eg. from using :select) are omitted, and derived/calculated columns (eg. again, from using :select) are added. Both #to_table_display and Object#pt methods take :only, :except, and :methods which work like the #to_xml method to change what attributes/methods are output. The normal output uses #inspect on the data values to make them printable, so you can see what type the values had. When that's inconvenient or you'd prefer direct display, you can pass the option :inspect => false to disable inspection.

Versions:

  1. 2.0.0 - September 4, 2016 (12.5 KB)
  2. 1.0.0 - April 21, 2013 (11.5 KB)
  3. 0.5.1 - August 18, 2012 (11.5 KB)
  4. 0.5.0 - August 18, 2012 (11.5 KB)

Authors:

  • Will Bryant

Owners:

F1c9a2d6b6be7599854a75793ecd872d

SHA 256 checksum:

3f8984e9ab26cb0527a35b2a7019c02d7b8c8805546281fcf5eab534ff37c690

Total downloads 6,591

For this version 654

Gemfile:
= Copy to clipboard Copied!

install:
=

Licenses:

N/A

Required Ruby Version: >= 0

Links: