# Rendering partials from other controllers

**URL:** <https://www.ruby-forum.com/t/rendering-partials-from-other-controllers/71598>\
**Category:** Rails\
**Created:** [October 10, 2006, 7:03am UTC](https://www.ruby-forum.com/t/rendering-partials-from-other-controllers/71598 "2006-10-10T07:03:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![smc7000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Post date:** [October 10, 2006, 7:03am UTC](https://www.ruby-forum.com/t/rendering-partials-from-other-controllers/71598/1 "2006-10-10T07:03:15Z")

</div>

Hey guys - just a quick question about partials. I’m trying to put  
together an administrative console for my site (which is working great,  
thanks to the excellent and consistent help I’ve received here). Since  
I’m still new at this, I figured the easiest way to get it up and  
running quickly would be to use the views that already exist in my  
numerous scaffolds. However, since each view and partial resides in a  
different directory than the console, I would need to call them in a  
different way than just render :partial =\> ‘partialname’. I tried  
plugging in the :controller as an option, but no go. Is what I’m trying  
to do even possible? Or even better, is there a better way that I could  
be going about this?

Thanks!

---

<div class="post-metadata">

**Author:** ![smc7000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Post date:** [October 10, 2006, 7:15am UTC](https://www.ruby-forum.com/t/rendering-partials-from-other-controllers/71598/2 "2006-10-10T07:15:41Z")

</div>

Just include the directory name, so if you have  
app/views/foo/\_foo.rhtml, then:  
render :partial=\>‘foo/foo’

Cheers!

---

<div class="post-metadata">

**Author:** ![smc7000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Post date:** [October 10, 2006, 7:22am UTC](https://www.ruby-forum.com/t/rendering-partials-from-other-controllers/71598/3 "2006-10-10T07:22:02Z")

</div>

Sweet! You rock. Thanks!

---

<div class="post-metadata">

**Author:** ![smc7000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ed655f/32.png) [@smc7000](https://www.ruby-forum.com/u/smc7000)\
**Post date:** [October 10, 2006, 7:37am UTC](https://www.ruby-forum.com/t/rendering-partials-from-other-controllers/71598/4 "2006-10-10T07:37:50Z")

</div>

yep,

1 thing I started doing about a month ago is putting all of my  
partials in the layouts directory.

Then, they are all in one place and easy to find later.

Maybe it would make sense to create a partials directory.

The layouts directory is good though. Usually I only have  
about 3 or 4 or 5 layouts in there anyway.

-Dan

On 10/9/06, Sean C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sweet! You rock. Thanks!
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
removed\_email\_address@domain.invalid

> **[Bikle.com may be for sale - PerfectDomain.com](https://perfectdomain.com/domain/bikle.com)**
>
> Checkout the full domain details of Bikle.com. Click Buy Now to instantly start the transaction or Make an offer to the seller!
