# Where to put partials called from the application layout

**URL:** <https://www.ruby-forum.com/t/where-to-put-partials-called-from-the-application-layout/61211>\
**Category:** Rails\
**Created:** [May 21, 2006, 9:16pm UTC](https://www.ruby-forum.com/t/where-to-put-partials-called-from-the-application-layout/61211 "2006-05-21T21:16:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [May 21, 2006, 9:16pm UTC](https://www.ruby-forum.com/t/where-to-put-partials-called-from-the-application-layout/61211/1 "2006-05-21T21:16:16Z")

</div>

Hello,

My main application layout, app/views/layout/application.rhtml looks  
like this:

something  
render partial\_1  
something else  
render partial\_2  
something else  
render partial\_3

The partials are not really doing anything, i use them to keep the  
layout modular (i.e . to have ~30 lines instead of 200). Now, the  
question is where to put \_partial\_1.rhtml, \_partial\_2.rhtml,  
\_partial\_3.rhtml.  
If i am putting them to app/views/layouts, they are not found when a  
view using this layout (e.g. view of the controller foo) is rendered -  
but i don’t want to put them into app/views/layouts/foo/ either since if  
i am going to use the same layout to render the controller bar, i will  
have to copy them there too, which not DRY.  
I am quite sure this is a noob question, so what is the standard way to  
do this?

TIA,  
Peter

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [May 21, 2006, 9:34pm UTC](https://www.ruby-forum.com/t/where-to-put-partials-called-from-the-application-layout/61211/2 "2006-05-21T21:34:23Z")

</div>

On Sunday, May 21, 2006, at 9:14 PM, Peter S. wrote:

> render partial\_3  
> I am quite sure this is a noob question, so what is the standard way to  
> do this?
> 
> TIA,  
> Peter
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

create a directory called ‘shared’ in your view path.

then call them as ‘shared/partial1’ and they should all go to the same  
place.

\_Kevin

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [May 21, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/where-to-put-partials-called-from-the-application-layout/61211/3 "2006-05-21T21:37:40Z")

</div>

Kevin,

> create a directory called ‘shared’ in your view path.
> 
> then call them as ‘shared/partial1’ and they should all go to the same place.

Thx a lot, i have been thinking about this too, just have been wondering  
what’s the standard way of doing it since something like this (AFAIK)  
was not discussed in the AWDwR book. So thanks again.

Cheers,  
Peter

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [May 21, 2006, 10:23pm UTC](https://www.ruby-forum.com/t/where-to-put-partials-called-from-the-application-layout/61211/4 "2006-05-21T22:23:36Z")

</div>

On Sunday, May 21, 2006, at 9:36 PM, Peter S. wrote:

> Cheers,  
> Peter
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

If you look carefully, you will see that AWDwR does mention shared  
partials.

\_Kevin
