Forum: Ruby on Rails Partials question

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.
Martin G. (Guest)
on 2006-05-26 02:51
(Received via mailing list)

I have a question concerning the use of local variables in partials.
Given that obviously all instance variables of the invoking controller
are available to the partial (as they are available to the normal
template), what situations are there in which to use local variables?
Another question concerns the :object parameter in render :partial =>
"xxx", :object => @foo. Is it appropriate to use both :object and
locals if I need to pass in more than one parameter? Or shall I set
them all up as locals? Or can I anyway use controller instance
variables? I'm a bit confused :) These questions come up as I am in
the middle of seriously drying up my code :)

Any suggestions?

This topic is locked and can not be replied to.