Forum: Ruby on Rails Partials vs. Helpers

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Bf1e5a140a444bdc5011185bba3a1ed3?d=identicon&s=25 Sharkie Landshark (sharkie)
on 2007-07-16 09:53
I have several partials containing dynamic codes (already memcached all
the fragments as best I could), which I reuse ( render :partial =>
"stuff.rhtml" ) a lot within a single action call. For example, I have a
partial which defines how an entry is to be formated in HTML. I have 40
entries on a page, so the partial is rendered 40 times in a single

Not knowing the innerworking of Rails, I have several questions.

1) Within that single action call, is the file _stuff.rhtml read from
the file system just once or 40 times?

2) Does the file _stuff.rhtml gets compiled or cached somewhere? I am
asking this because when I play with DRYML, it seems that its
equivalence of partials get cached somehow.

3) If _stuff.rhtml read from file system 40 times in the action call,
should I rather convert this into a helper? Since, helper is cached?

This topic is locked and can not be replied to.