开发者

Can I ignore certain fields that are too long in Hirb?

I am using Hirb in my Rails console to try to display mongoid records in a nicer looking table, but the _id, created_at, and updated_at fields take too much space and, even though I really have one meaning field, name, when I do a Project.first it returns a rather disintegrated table:

Can I ignore certain fields that are too long in Hirb?

Is there any ch开发者_StackOverflow社区ance that there's a way to 'ignore' or 'hide' certain fields?


When you open up hirb, run this:

table projects, :fields => [:name]

Then Project.all and enjoy! ;-)

Also see this: Hirb - Irb On The Good Stuff.

UPDATE:

"Hirb also supports a yaml configuration file (config/hirb.yml or ~/.hirb.yml)"

  ---
    :output:
      Project:
        :options:
          :fields:
            - name
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜