The ELC Community Blog
A knowledge exchange on Ruby on Rails and Agile Development
A room hung with pictures is a room hung with thoughts
by doram on September 24, 2007
If like me, it helps to have a picture of the persistent data in your app, then you might want to try one of the following rails plugins:
Rails Application Visualizer (RAV)
The first option I tried; Rails Application Visualizer works in conjunction with GraphViz to produce pictures of your models.1. Install GraphViz
$ sudo port install graphviz
2. Check out RAV into your plugins directory:
$ cd $RAILS_ROOT/vendor/plugins $ svn co svn://rubyforge.org/var/svn/rav/stable rav
3. Download, and apply the patch to ignore abstract, and non-db models (Optional step):
$ cd $RAILS_ROOT/vendor/plugins/rav $ curl http://rubyforge.org/tracker/download.php/1332/5243/14087/2537/cope_with_abstract_and_non_db_models.patch > cope_with_abstract_and_non_db_models.patch $ patch -p0 < ./cope_with_abstract_and_non_db_models.patch
4. Generate a diagram of your Models:
To produce a png file with your model objects type:$ cd $RAILS_ROOT $ rake visualize CONTROLLERS=no
RailRoad
The second option is RailRoad, which has more features than RAV. Like RAV it also uses GraphViz to handle the graph rendering.1. Install GraphViz
(see above)2. Get the RailRoad gem
$ gem install -y railroad
3. Generate a diagram of your Models:
To generate a high level overview of your models with no attributes type:$ railroad -b -M | dot -Tpdf > models.pdfEnjoy!
Timeline
- Sandboxing in ruby
- Its about the team
- RSpec Tutorial
- Amazon S3: Simple(?) Storage Service
- Ready for hockey season?
- A room hung with pictures is a room hung with thoughts
- Nesting 'document.write'
- Jonathan Siegel Keynote at RailsConf
- Funny or Die in top 10 by PC World
- RailsConf day 2 - Presentations galore
- RailsConf day 1, the Swedish perspective...
Comments
To exclude some classes from your diagram use:
railroad -e model.rb,model2.rb -M | dot -Tpdf > models.pdf