A long-lived project that still receives updates
Partial Inspector
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies
 Project Readme

Partial Inspector

A tiny, developer-focused gem to help you find where your Rails partials are used.

When working on large Rails projects, it's easy to lose track of where a partial is rendered throughout the codebase. partial_inspector scans your project and shows exactly which files render a given partial, making it much easier to refactor, test or remove unused partials confidently.

Installation

gem install partial_inspector

How it works?

  1. Open irb

  2. Require the gem:

    require "partial_inspector"
    

Find where a partial is used

  1. Run the scanner:

    PartialInspector.scanner.inspect_files_rendering_partial('path/to/partial')
    
  2. Example Output

    image

Find unused partials

  1. Run the scanner:

    PartialInspector.scanner.scan_unused_partials
    
  2. Example Output

    image

Find partial tree

  1. Run the scanner:

    PartialInspector.scanner.inspect_partial_tree('path/to/partial')
    
  2. Example Output

    image