Skip to content

markevans/partial_identifier

Repository files navigation

Partial Identifier

Ever been checking your development rails app in the browser and wanted to know which ERB file a part of your page is from? Wanted to know the rendered file hierarchy all the way up to the layout? Wanted to quickly open one of those files in textmate?

This plugin makes it easy peasy to do just that!

Usage

  1. Install the plugin

     script/plugin install git://github.com/markevans/partial_identifier.git
    
  2. Browse your app in development mode (after restarting the server) Press Shift + Ctrl + P to toggle the partial identifier on.

  3. Click on a part of the page you want to inspect - this will display its partial hierarchy in the top left (each time you click you will update the partial hierarchy)

  4. If you have textmate, clicking one of the partial links will open that file in textmate!

  5. When finished, press Shift + Ctrl + P again to turn the partial identifier off.

Notes

  • This only works in development mode, so won't interfere with anything on production
  • If you're using version control you will probably want to ignore the created files as it's useful for your development only
  • It is fairly unobtrusive to the page DOM - it simply inserts invisible divs
  • It uses the bundled version of jquery if you don't already have it, otherwise uses the one you're using
  • I've noticed that it doesn't work too well if a partial wraps a table row <tr> element, because Firefox etc. automatically remove divs (generated by this plugin) from inside the table.
  • It's quite slow turning on if firebug is open - just close the panel and it should speed up.
  • You can temporarily disable it by doing touch public/partial_identifier/bypass (you may need to restart the server). Delete this file to re-enable it.

TODO

Get it to work with HAML

Copyright (c) 2008 [Mark Evans], released under the MIT license

About

Plugin for rails, using jQuery, which allows you to identify rendered templates and link to them in TextMate

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published