Reputation: 291
Is there a way to display Active Record results in table format in the script/console environment?
Upvotes: 29
Views: 12701
Reputation: 1039
Also check out http://tableprintgem.com. It's an efficient way to view a list of structured data, making it easy to scan and compare across large swaths of records (and for many people, it's a comfortable return to the SQL command line output of yesteryear :)
The most powerful feature of table_print is the ability to see your data in the context of other objects it relates to. You can reference nested objects with the method chain required to reach them. This example is showing data from three different tables:
There's a short intro screencast at http://tableprintgem.com
(full disclosure: I wrote this gem)
Upvotes: 11
Reputation: 106157
Yep. There's a gem called hirb that does this very well.
Upvotes: 38