How to Visualize Your Rails ERD Diagram Instantly
by Huy Nguyen

Rails comes with a schema.rb file that contains a clear definition of your database tables and how they're linked together. But what if you want to generate an entity-relationship diagram (ERD) of your Rails app to quickly get a sense of how they look?
Since we launched dbdiagram.io, a free and simple tool to draw entity relationship diagram 4 weeks back, we've been getting tons of feedback. Among those, a lot of people are asking if we support integrations with Rails, Django, or Laravel.
So today I'm excited to share that we've fulfilled one of the first steps: we now support Rails! If you are a Rails developer, you can quickly generate a database relationship diagram (or ERD diagram) from your schema.rb, in just 3 simple steps:
- Open dbdiagram.io
- Click Import → From Rails (schema.rb)
- Paste (or upload) your schema.rb
- Profit!
Some cool features that the tool has:
- Auto recognize your Rails relationship: It reads both explicit and implicit foreign key definitions (and convention), then translates them to the correct relationships. Explicit definitions like
add_foreign_key()
ort.references 'user'
are recognized; implicit (convention) definition liket.integer user_id
are also recognized! - You can generate a beautiful PDF file afterwards.
- It's completely free!
If you want to give it a try, go to dbdiagram.io and upload your schema.rb to see how your rails erd diagram look.
What's happening in the BI world?
Join 15k+ people to get insights from BI practitioners around the globe. In your inbox. Every week. Learn more
No spam, ever. We respect your email privacy. Unsubscribe anytime.
From SQL Queries To Beautiful Charts
Connect to your database and build beautiful charts with Holistics BI
Learn More
"Holistics is the solution to the increasingly many and complex data requests from the operational teams"
Senior Data Analyst, Grab