I’m down in L.A. doing some work with a company and was documenting the way their system works. I thought to myself, ‘It would be awesome if I could visualize the model relationships’, after all, they had an excessive amount. A quick google search returned RailRoad. Simple to install:
1 | $ gem install railroad |
Then it’s just a matter of running it.
1 2 | $ cd rails_app/ $ railroad -aio models.dot -M |
To view the models.dot you need to install, if on a Mac, graphviz. Unfortunately the pkg they have for download doesn’t work on Leopard, so you will need to install from macports.
1 | $ sudo port install graphviz |
Then, to convert to PNG, simply:
1 | $ dot -Tpng models.dot > models.png |
Here is a sample png image from the railroad website when run against the depot project.
Simple, eh?
Related posts:
