Hirb is a simple gem that lets you view objects as table (with their attributes as columns and their data as rows). Collections are shown as a table. Installing the gem is easy sudo gem install hirb. The easiest way to handle including it into IRB is to add it to your .irbrc file in your home directory:
require 'rubygems' require 'hirb' Hirb::View.enable
Or you can leave off the last line, which will require you to type that into your console whenever you want it to turn on. (This is the setting I use, because I am not always working with large data sets, but when I do I turn it on).
Another neat trick is to output your ActiveRecord SQL right into your console. This is a nice if you’re wanting to optimize queries or you just are curious as to what ActiveRecord is really doing. You could view the logs, but this puts everything into context. Also if you don’t see a query happening you know that you’re still working with an in-memory object. Type the below into your Rails console whenever you want to see SQL queries in-line with your ActiveRecord calls:
>> ActiveRecord::Base.logger = Logger.new(STDOUT)
You’ll end up with a console that looks like the image below. Pretty nice if you have a lot of model work or just want to better visualize ActiveRecord calls and objects.
Learn More
http://tagaholic.me/2009/03/13/hirb-irb-on-the-good-stuff.html

