# Share layouts between applications

**URL:** <https://www.ruby-forum.com/t/share-layouts-between-applications/128481>\
**Category:** Rails\
**Created:** [February 8, 2008, 12:30am UTC](https://www.ruby-forum.com/t/share-layouts-between-applications/128481 "2008-02-08T00:30:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [February 8, 2008, 12:30am UTC](https://www.ruby-forum.com/t/share-layouts-between-applications/128481/1 "2008-02-08T00:30:39Z")

</div>

Is there a way to configure Rails to use layouts from an absolute  
path? I’d like to share one layout file between a ton of applications.  
The only thing close has been a symbolic link, which works but will  
not be acceptable in our environment. Even a way to use partials from  
an absolute path would suffice.

Thanks in advance…

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [February 8, 2008, 2:02am UTC](https://www.ruby-forum.com/t/share-layouts-between-applications/128481/2 "2008-02-08T02:02:13Z")

</div>

Not sure about the layout, but you can do:

render :file =\> ‘/path/to/a/file.html’, :layout =\> true

You can omit the layout bit at the end if you just want to render the  
file without your layout.

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [February 8, 2008, 4:41am UTC](https://www.ruby-forum.com/t/share-layouts-between-applications/128481/3 "2008-02-08T04:41:45Z")

</div>

It’s actually not that hard to symlink the app/views/layouts folder to  
like  
/rails/apps/shared\_layouts

I’ve done that before with success. Another alternative is to “share”  
them  
via SVN Externals… the layouts is its own project in svn, and each  
rails  
app references the layouts project.

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [February 8, 2008, 5:23pm UTC](https://www.ruby-forum.com/t/share-layouts-between-applications/128481/4 "2008-02-08T17:23:26Z")

</div>

Well, the issue there would be we don’t want to call it all over the  
place. I need it to work more like application.erb, or at most be  
specified with layouts call.

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [February 8, 2008, 5:28pm UTC](https://www.ruby-forum.com/t/share-layouts-between-applications/128481/5 "2008-02-08T17:28:08Z")

</div>

No, not hard at all. And it works great. But I won’t be able to do  
symlinks in our deployment environment.

We are not deploying via SVN, so sharing there won’t work. The  
environment is fairly constrained to reuse what exists and is running  
via JRuby and Tomcat.
