2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Ruby] Hirbで画面の幅が足りないとき表示を切り詰められないようにする

2
Last updated at Posted at 2017-03-30

やりたいこと

通常、Hirbを使ってActiveRecordオブジェクトを表示すると、テーブル幅=画面の幅となり、おさまらないフィールドは切り詰められて「...」で表示されるが、切り詰めをやめて全体を表示させるようにしたい。

解決法

Hirb::View.resize(200)

これでテーブル幅を200文字分に設定できる。
Hirbのソースを読んで適当にやってみたらできただけなので、これが正しい解決法かどうか知らない。

あるいは

Hirb.disable

で一時的にHirbを無効にすることもできる。

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?