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.
Kevin H. (Guest)
on 2007-05-30 16: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.
Gregory S. (Guest)
on 2007-05-30 17: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
Alain R. (Guest)
on 2007-05-30 18: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 R.
--------
http://blog.ravet.com
Kevin H. (Guest)
on 2007-05-30 18: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.