# Partials and config.load\_paths

**URL:** <https://www.ruby-forum.com/t/partials-and-config-load-paths/136934>\
**Category:** Rails\
**Created:** [May 7, 2008, 3:27pm UTC](https://www.ruby-forum.com/t/partials-and-config-load-paths/136934 "2008-05-07T15:27:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaddyTheGoose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MaddyTheGoose](https://www.ruby-forum.com/u/MaddyTheGoose)\
**Post date:** [May 7, 2008, 3:27pm UTC](https://www.ruby-forum.com/t/partials-and-config-load-paths/136934/1 "2008-05-07T15:27:49Z")

</div>

Is it possible to define a sub directory in the views folder to put  
partials? In my config.load\_paths in the environment.rb I’ve added an  
entry to the effect of “config.load\_paths += %W( #{RAILS\_ROOT}/app/  
views/my\_item/my\_partials )” where I’ve placed partials but they can’t  
be found when referencing them from the views/my\_item.rhtml file. Am I  
missing something? (it works fine when I place the partials in the  
same directory as my\_item.rhtml file)

---

<div class="post-metadata">

**Author:** ![MaddyTheGoose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MaddyTheGoose](https://www.ruby-forum.com/u/MaddyTheGoose)\
**Post date:** [May 7, 2008, 3:51pm UTC](https://www.ruby-forum.com/t/partials-and-config-load-paths/136934/2 "2008-05-07T15:51:01Z")

</div>

config.load\_paths is for libs i think

if you want to render a partial in a special place, just give it the  
path:

render :partial =\> “/my\_path/my\_partial”

---

<div class="post-metadata">

**Author:** ![MaddyTheGoose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MaddyTheGoose](https://www.ruby-forum.com/u/MaddyTheGoose)\
**Post date:** [May 7, 2008, 3:52pm UTC](https://www.ruby-forum.com/t/partials-and-config-load-paths/136934/3 "2008-05-07T15:52:07Z")

</div>

On 7 May 2008, at 14:26, MaddyTheGoose wrote:

> Is it possible to define a sub directory in the views folder to put  
> partials? In my config.load\_paths in the environment.rb I’ve added an  
> entry to the effect of “config.load\_paths += %W( #{RAILS\_ROOT}/app/  
> views/my\_item/my\_partials )” where I’ve placed partials but they can’t  
> be found when referencing them from the views/my\_item.rhtml file. Am I  
> missing something? (it works fine when I place the partials in the  
> same directory as my\_item.rhtml file)

config.load\_paths is for something entirely different. If you render  
the partial foo/bar then it will render the partial app/views/foo/  
\_bar.html.erb (or whatever file type it happens to be)

Fred

---

<div class="post-metadata">

**Author:** ![MaddyTheGoose](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/49beb7/32.png) [@MaddyTheGoose](https://www.ruby-forum.com/u/MaddyTheGoose)\
**Post date:** [May 7, 2008, 4:41pm UTC](https://www.ruby-forum.com/t/partials-and-config-load-paths/136934/4 "2008-05-07T16:41:20Z")

</div>

I figured I must be off track with this. Thanks for pointing me in the  
right direction.

On May 7, 9:51 am, Thorsten M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
