Performance issue on partial_for_class

Antonio Terceiro terceiro at colivre.coop.br
Tue Apr 15 17:50:33 BRT 2014


On Tue, Apr 15, 2014 at 01:30:32PM -0300, Bráulio Bhavamitra wrote:
> Hello all,
> 
> Today I had to check partial_for_class method on
> app/helpers/application_helper.rb to see why it wasn't finding the partial.
> 
> I've notice that it tries to find the partial on each view path. But that
> is done again by 'render :partial => ...' method. So why we need to check
> if the partials exists and let rails alone do that?

because partial_for_class needs to first look for a partial
corresponding to the actual class of the object, then for its
superclass, then the superclass of the superclass, ...

-- 
Antonio Terceiro <terceiro at colivre.coop.br>
Colivre - Cooperativa de Tecnologias Livres
http://www.colivre.coop.br/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20140415/87f14326/attachment.pgp>


More information about the Noosfero-dev mailing list