Search code examples
ruby-on-railsrubygemspartials

How to get an overview over partials in ruby on rails


I am using ruby on rails 5.0.

It is common practice to use partials to share code fragments for views (e.g., in order to avoid duplication). Partials are files that start with an underscore, e.g., "_fields.html.erb".

After a certain time the directories are full of partials, and it can become quite hard to keep an overview which view calls which partials and which partial calls another partial et cetera.

Question: Is there an "easy" way or a tool or a gem that can help to give an overview of the call tree or the call dependencies? Perhaps by rendering an html page, generating a png or something similar.

Thank your for your thoughts!


Solution

  • This is an older gem that does that. It lets you view a tree-ish list of your partials. https://github.com/skwp/PartialMap