MCPcopy Index your code
hub / github.com/aki77/rails-template-inspector

github.com/aki77/rails-template-inspector @v0.8.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.8.0 ↗ · + Follow
40 symbols 67 edges 10 files 0 documented · 0%

Browse by type

Functions 22 Types & classes 18
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

<rails-inspector>

This custom element allows users to jump to local IDE code directly from browser element by just a simple click. It supports Rails templates.

Demo

Usage

In config/environments/development.rb:

config.action_view.annotate_rendered_view_with_filenames = true

In app/views/layouts/application.html.erb:

<!DOCTYPE html>
<html>
<head>

</head>
<body>

<%= yield %>

<% if Rails.env.development? %>
  <script type="module" src="https://cdn.jsdelivr.net/npm/@aki77/rails-template-inspector@latest/dist/rails-template-inspector.mjs"></script>
  <rails-inspector url-prefix="vscode://file" root="<%= Rails.root %>" combo-key="command-shift-v"></rails-inspector>


<% end %>
</body>
</html>

Attributes

  • url-prefix: Custom URL Scheme for editor. (default: vscode://file)
  • Examples
    • Visual Studio Code: vscode://file
    • RubyMine: x-mine://open?file=
    • MacVIM: mvim://open?url=file://
    • Emacs: emacs://open?url=file://
  • combo-key: Key to toggle inspector. (default: meta-shift-v)
  • any number of modifiers control, shift, alt, meta, command followed by zero or one regular key, separated by -.
  • examples: control-shift, control-o, control-alt-s, meta-x, control-meta
  • root: Rails root dir. (default: /)
  • no-auto-disable: Keep the inspector when you open the editor. (default: false)

Notes

Disable confirmation dialog when opening external apps from Chrome on mac.

defaults write com.google.Chrome URLAllowlist -array "vscode://*"

https://owky.github.io/blog/2022/01/09/mac-chrome-url-allow-list.html

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 16
Class 12
Function 6
Interface 6

Languages

TypeScript100%

Modules by API surface

src/rails-inspector.ts13 symbols
src/rails-inspector-dropdown.ts9 symbols
src/utils.ts5 symbols
src/rails-inspector-button.ts4 symbols
types/rails-inspector.d.ts3 symbols
types/rails-inspector-dropdown.d.ts3 symbols
types/rails-inspector-button.d.ts3 symbols

For agents

$ claude mcp add rails-template-inspector \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page