Forum: Ruby on Rails Partials question

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.
5e518814b76962fdd1ad0e74dfac5ea7?d=identicon&s=25 Martin Gamsjaeger (Guest)
on 2006-05-26 00:51
(Received via mailing list)
Hiall,

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?

cheers
Martin
This topic is locked and can not be replied to.