[Rails] sharing partials across controllers.

Stephen Bartholomew
Tue, 30 May 2006 09:17:06 -0000

Say you have a basket view partial that you want to use from other
views.  You can do it like this:

render(:partial => ''basket/view'')

Basically, if the argument has a slash, it''ll treat look for the
partial
from the root of the views directory.

Hope that helps,

Steve



Sam Donaldson wrote:
> Hi,
>
> I was wondering if it is possible to share a partial across views in
> different controllers?  If so, how would I go about doing this?  Would I
> pass in a parameter to render(...) of the partial telling it where it is
> located?
>
> And help would be appreciated.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.7.4/351 - Release Date: 29/05/2006