February 8, 2008, 12:30am
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…
February 8, 2008, 2:02am
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.
February 8, 2008, 4:41am
It’s actually not that hard to symlink the app/views/layouts folder to
I’ve done that before with success. Another alternative is to “share”
via SVN Externals… the layouts is its own project in svn, and each
app references the layouts project.
February 8, 2008, 5:23pm
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.
February 8, 2008, 5:28pm
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.