Visualize Rails schema.rb with tool/plugin/script

2020-07-02 05:54发布

I am looking for a tiny tool/script/plugin to visualize my Rails schema.rb file so that our project does not have to maintain a separate diagram manually.

Do you have any experiences on that subject?

4条回答
该账号已被封号
2楼-- · 2020-07-02 06:32

You can also checkout Schemapper for Rails 3.0+

查看更多
疯言疯语
3楼-- · 2020-07-02 06:49

Confirming the top answer as the way to go. You can take the DOT output from Railroad to graphviz-dev.appspot.com to generate the image online.

As others have stated, it would be nice if you could manually rearrange the output.

查看更多
ゆ 、 Hurt°
4楼-- · 2020-07-02 06:51

Check out RailRoad.

It creates diagrams for models and controllers. I bet it will do what you want. It produces DOT files which can be viewed with Graphviz or other programs.

I've had some success with it, but when you have a ton of models, you may need to do some manual rearrangement to get a decent looking diagram.

RailRoad example
(source: rubyforge.org)

查看更多
放荡不羁爱自由
5楼-- · 2020-07-02 06:54

Checkout RailRoady for a Rails 3 project. It's forked from RailRoad.

https://github.com/preston/railroady

查看更多
登录 后发表回答