Forum: Ruby on Rails Print name of partial

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D19b87c7537fb604845a5c265ce8ecf0?d=identicon&s=25 Kevin Hankinson (kevinf4f)
on 2007-05-30 14:49
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.
675475d0b65710be6d992eb5eb2c61c2?d=identicon&s=25 Gregory Seidman (Guest)
on 2007-05-30 15:57
(Received via mailing list)
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
Ba3a00606eb530dcab2c4a6a59bf366d?d=identicon&s=25 Alain Ravet (Guest)
on 2007-05-30 16:35
(Received via mailing list)
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 Ravet
--------
http://blog.ravet.com
D19b87c7537fb604845a5c265ce8ecf0?d=identicon&s=25 Kevin Hankinson (kevinf4f)
on 2007-05-30 16:45
Thank You Alain, just what I was looking for. I am sure many others will
find this useful.
This topic is locked and can not be replied to.