使用工具/插件/脚本可视化 Rails schema.rb
我正在寻找一个小工具/脚本/插件来可视化我的 Rails schema.rb 文件,以便我们的项目不必手动维护单独的图表。
您在这方面有什么经验吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看铁路。
它为模型和控制器创建图表。我打赌它会做你想做的事。它生成可以使用 Graphviz 或其他程序查看的 DOT 文件。
我已经取得了一些成功,但是当您有大量模型时,您可能需要进行一些手动重新排列才能获得看起来不错的图表。
(来源:rubyforge.org)
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.
(source: rubyforge.org)
查看 RailRoady 的 Rails 3 项目。它是从 RailRoad 分叉出来的。
https://github.com/preston/railroady
Checkout RailRoady for a Rails 3 project. It's forked from RailRoad.
https://github.com/preston/railroady
您还可以查看 Schemapper for Rails 3.0+
You can also checkout Schemapper for Rails 3.0+
确认最佳答案是要走的路。
您可以将 Railroad 的 DOT 输出发送到 graphviz-dev.appspot.com 来在线生成图像。
正如其他人所说,如果您可以手动重新排列输出,那就太好了。
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.