# Is there a way to use partial views from another category?

**URL:** <https://www.ruby-forum.com/t/is-there-a-way-to-use-partial-views-from-another-category/131364>\
**Category:** Rails\
**Created:** [March 8, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-use-partial-views-from-another-category/131364 "2008-03-08T21:18:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@ron](https://www.ruby-forum.com/u/ron)\
**Post date:** [March 8, 2008, 9:18pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-use-partial-views-from-another-category/131364/1 "2008-03-08T21:18:35Z")

</div>

Hi,

I have a partial view \_header.rhtml in my pages directory (views/  
pages/) and I’d like to reference that partial view from my blog  
directory. For a quick solution, I copied the file into the blog  
directory for the blog controller to use. But this makes me change  
two things everytime. Is there a way to reference a partial view in  
another directory so I can just use one file?

Thanks,

Ron

---

<div class="post-metadata">

**Author:** ![ron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@ron](https://www.ruby-forum.com/u/ron)\
**Post date:** [March 8, 2008, 9:28pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-use-partial-views-from-another-category/131364/2 "2008-03-08T21:28:37Z")

</div>

Ron wrote:

> another directory so I can just use one file?
> 
> Thanks,
> 
> Ron

Ron,

yes… \<%= render :partial =\> ‘subdir/partial\_name’ %\>

hth

ilan

---

<div class="post-metadata">

**Author:** ![ron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@ron](https://www.ruby-forum.com/u/ron)\
**Post date:** [March 8, 2008, 9:36pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-use-partial-views-from-another-category/131364/3 "2008-03-08T21:36:51Z")

</div>

Thanks!

Ron

On Mar 8, 12:28 pm, Ilan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![ron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/ecae2f/32.png) [@ron](https://www.ruby-forum.com/u/ron)\
**Post date:** [March 8, 2008, 9:38pm UTC](https://www.ruby-forum.com/t/is-there-a-way-to-use-partial-views-from-another-category/131364/4 "2008-03-08T21:38:37Z")

</div>

Thanks Ilan!

On Mar 8, 12:28 pm, Ilan B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
