perseverance
perseverance

Reputation: 6602

How do you output Ruby on Rails console database resultsets in a pretty format without installing a gem?

I am getting data returned from running a database query like User.first but because there are so many fields it is hard to read the information. I tried using pp User.first but it didn't make anything easier to read. Is there something built-in to RoR where I don't have to install a gem that prettifies it? Also, I don't want to write an each statement to break it down each time if possible.

Upvotes: 0

Views: 255

Answers (1)

Philip Hallstrom
Philip Hallstrom

Reputation: 19879

If you don't like pp's output, I'm not sure what other options you have. If you can get over not wanting a gem, Hirb does this nicely...

https://github.com/cldwalker/hirb

Upvotes: 1

Related Questions