ruby on rails diagram generator – RailRoad

I came across RailRoad today on another blog. Very cool idea. When I had done some work in the past, I found it hard to remember class names and method names. I’m used to a Java IDE like IDEA to do name completion, but that largely doesn’t exist for the Ruby world, or it may be available now. Generating diagrams from your code should help things a lot.

RailRoad is a diagram generator for Ruby on Rails applications. Actually, it’s a simple Ruby script that loads the application classes and analyzes its properties (attributes, methods) and relationships (inheritance, model associations like has_many, etc.) The output is a graph description in the DOT language, suitable to be handled with tools like Graphviz.

RailRoad can produce:
* Model diagrams, showing both inheritance hierarchy and models associations. You can choose to show the model “content columns” and its types.
* Controller diagrams, showing inheritance hierarchy. You can include the controllers’ methods, grouped by its visibility (public, protected, private.)

an example Model diagram

This entry was posted in Ruby On Rails. Bookmark the permalink.

One Response to ruby on rails diagram generator – RailRoad

  1. Jazzy says:


    How excatly do u exclude many models by the railroad?

    railroad -M -e [pd.rb,abc.rb] models -v ????

    Is this the way. If this is the way then itz not working on my system.

    Please help me in this ..

    thanks in advance..

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>