How to implement a global partial?

Quick question:

Whats the easiest way to implement a global partial? Where I can call
one partial from many different controllers (err controller views)?

IIRC, you can simply prefix the partial name with a path and it will


render :partial => "partials/myglobalpartial"

will render app/views/partials/_myglobalpartial.rhtml

Is that what you were looking for?

Why not put it in the layouts directory? You could just have
/layouts/_mypartial.rhtml and call like render :partial =>

I haven’t tried it, so I can’t verify if it works or not, but I’d much
rather keep items that are global in the layouts directory where my
is stored. Of course, I am assuming that you are using a layout… which
would be best if you are using the same base markup for all of your


Excellent, that was exactly what I was looking for. Thanks guys.