Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to better visualize Rails Models and Applications?

Is there a RailRoad replacement or something that provides diagrams like unto it for Rails 3.x? Presently you have to edit line 54 of app_diagram.rb from:

(OLD) STDOUT.reopen(PLATFORM =~ /mswin/ ? "NUL" : "/dev/null")
      to
(NEW) STDOUT.reopen(RUBY_PLATFORM =~ /mswin/ ? "NUL" : "/dev/null")

Finally I found on their Forums that if you run it with something like this:

  RUBYLIB=. railroad -o models.dot -M

It will actually run, but I didn't really get any output as per what should have appeared in the .dot file after opening it in OmniGraffle. Further, it seems to just simply gag on more complex enhancements like Hobo.

Is anyone familiar with something new or a fork of this project that's still in development?

PS - I found two other projects, however they seem to be in less maintained states than even RailRoad:

  • Rails Application Visualizer
  • Visualize Models
like image 429
ylluminate Avatar asked May 28 '11 06:05

ylluminate


People also ask

How can i Improve my rails app's view performance?

In this post, we explored how to improve your Rails app's view performance by making improvements to database utilization, using third-party tools and services and restricting what users see. If you are looking to improve your app's performance, start out simple and keep measuring as you go along!

How do I create a model in rails?

The command used to create models in rails begins with rails g model followed by the model’s name (e.g User) then the column name: type of data (e.g name: string) rails g model (the model name) (nameofcolumn1:data-type) (nameofcolumn2:data-type) In our case:- rails g model User name: string

What is the use of Association in rails?

Association methods in rails are used to show the relationship that exists between two models. It shows how models are connected. What is a rails model? It is a Ruby class that adds records to the database through a rails migration file. Generating a rails model automatically generates a migration file.

How to reduce HTML view rendering time in a rails app?

In a traditional Rails app, HTML view rendering takes a lot of time. Fortunately, there are measures you can take to reduce this. 1. Turbolinks This comes wrapped up in your standard Rails app. Turbolinks is a JavaScript library that works everywhere (even without Rails, like on static pages) and degrades gracefully on unsupported browsers.


2 Answers

It appears that Rails ERD may be what I'm really looking for at the moment. Seems to fit the bill precisely for my original question.

Works with Rails 3 and Hobo, which was more of my intention for "sanity checking" my models against initial designs I put together when conceptualizing projects.

enter image description here

like image 186
ylluminate Avatar answered Sep 18 '22 14:09

ylluminate


RailRoady is the updated RailRoad, for Rails 3.

BUT note that the latest version (v1.0.2) has a known known issue that breaks rails generate scaffold. I tend to only enable it in my Gemfile when I need to generate the diagram(s), and then I disable it.

like image 31
Jits Avatar answered Sep 19 '22 14:09

Jits