0.0
No release in over a year
**Rails Model Viz** is a development tool that automatically visualizes your Rails application's models, associations, and (optionally) column details using Mermaid.js. This gem provides both a command-line task and a Rails Engine interface, allowing you to view interactive entity-relationship diagrams (ER diagrams) directly in your browser. It helps developers quickly understand, explore, and document the structure of their ActiveRecord models.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

RailsModelViz

RailsModelViz is a Rails engine (and optional rake task) that visualizes your ActiveRecord models and associations using Mermaid.js. It automatically generates diagrams of your models’relationships (and optionally columns) in a clear and interactive format.

Installation

  1. Add this line to your application’s Gemfile:
gem 'rails_model_viz'
  1. Then execute:
bundle install

Usage

  1. Mount the Rails Engine

In your main application’s config/routes.rb, mount the engine so you can access the visualization:

Rails.application.routes.draw do

  # Other routes...
  if Rails.env.development?
    mount RailsModelViz::Engine, at: '/rails_model_viz'
  end
end

After this, start your Rails server and navigate to:

http://localhost:3000/rails_model_viz

You should see a Mermaid-based diagram of your models’ relationships.

relations

  1. Toggle Columns View

By default, RailsModelViz may show only associations. If you’d like to view columns as well, you can pass a mode=columns parameter. For example:

http://localhost:3000/rails_model_viz?mode=columns

This will enrich each entity in the diagram with column names (and types).

columns

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/PeterTakahashi/rails_model_viz. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Feel free to add more sections (e.g., advanced configuration, known issues, screenshots, etc.) as you see fit!