Franz Bettag wrote:> Alex Wayne wrote:
>> Franz Bettag wrote:
>>> Hi guys,
>>>
>>> i was wondering if there is any possibility to render a layout on
the
>>> fly instead of putting it into the layouts/ folder. Any ideas?
>>
>> Not sure what you mean. Layouts are rendered just like any rhtml file.
>
> Yeah but normal .rhtml files have to be in the layouts folder. I want to
> load the layout from another website everytime the shop gets called. So
> not store them locally. I know this i quite bw consuming on sites with
> many hits but my customer want''s it that way :)
I took a look at the Rails API and found these examples:
# Renders the template located at the absolute filesystem path
render :file => "/path/to/some/template.rhtml"
render :file => "c:/path/to/some/template.rhtml"
# Renders a template within the current layout, and with a 404 status
code
render :file => "/path/to/some/template.rhtml", :layout =>
true,
:status => 404
render :file => "c:/path/to/some/template.rhtml", :layout =>
true,
:status => 404
# Renders a template relative to the template root and chooses the
proper file extension
render :file => "some/template", :use_full_path => true
and
# Renders the template located in
[TEMPLATE_ROOT]/weblog/show.r(html|xml) (in Rails,
app/views/weblog/show.rhtml)
render :template => "weblog/show"
--
Posted via http://www.ruby-forum.com/.