# Shared Partial Folder Inheritance

**URL:** <https://www.ruby-forum.com/t/shared-partial-folder-inheritance/128694>\
**Category:** Rails\
**Created:** [February 10, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/shared-partial-folder-inheritance/128694 "2008-02-10T17:54:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [February 10, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/shared-partial-folder-inheritance/128694/1 "2008-02-10T17:54:58Z")

</div>

I am rendering the partial “shared/list” from within a controller.  
This partial in turn renders the partial “shared/listitem”.

My question is:

Is there an option for render to inherit the location of the called  
partial so i can call the partial ‘listitem’, or must i specify the  
sub-partial as ‘shared/listitem’. i.e. relative as opposed to  
absolute.

If not, can you think of a reason why this would be? It seems a  
nuisance to code all shared or cross-controller views with absolute  
locations and could provide problems with future application  
expansions.

Any thoughts on the best-practice way to overcome this?

Matt Williams

---

<div class="post-metadata">

**Author:** ![matt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a6a055/32.png) [@matt](https://www.ruby-forum.com/u/matt)\
**Post date:** [February 10, 2008, 7:46pm UTC](https://www.ruby-forum.com/t/shared-partial-folder-inheritance/128694/2 "2008-02-10T19:46:28Z")

</div>

On Feb 10, 2008, at 8:54 AM, Matt wrote:

> If not, can you think of a reason why this would be? It seems a  
> nuisance to code all shared or cross-controller views with absolute  
> locations and could provide problems with future application  
> expansions.
> 
> Any thoughts on the best-practice way to overcome this?

I create an instance var in application.rb which is a hash of paths I  
will use throughout the application. I use that for all path  
references. If I need to relocate things, there’s one place to make  
that change.

I have a number of tibits for dealing with partials and layouts in an  
article here:

[http://www.railsdev.ws/blog/3/modular-page-assembly-in-rails/](http://www.railsdev.ws/blog/3/modular-page-assembly-in-rails/)

–  
def gw  
writes\_at ‘www.railsdev.ws’  
end
