Print name of partial

DRY works, but when applied to partials it does make debugging someone
else code more difficult!

Is there a way to add a debug line (in each _file.rhtml) that would
print out the name of the partials that comprise a page? This would be a
BIG help in drilling down into a page to identify exactly which view is
responsible for each part of a page.

On Wed, May 30, 2007 at 02:49:06PM +0200, Kevin Hankinson wrote:

DRY works, but when applied to partials it does make debugging someone
else code more difficult!

Is there a way to add a debug line (in each _file.rhtml) that would
print out the name of the partials that comprise a page? This would be a
BIG help in drilling down into a page to identify exactly which view is
responsible for each part of a page.

You’ll have to do some digging in the Rails source, but you can monkey
patch something into the render method.

–Greg

Kevin,

Is there a way to add a debug line (in each _file.rhtml) that would
print out the name of the partials that comprise a page?

The annotate_renders plugin does just that :

http://agilewebdevelopment.com/plugins/annotate_renders
http://svn.livsey.org/plugins/annotate_renders/

Alain R.

http://blog.ravet.com

Thank You Alain, just what I was looking for. I am sure many others will
find this useful.