4
我有一个液体模板,我需要渲染一个局部的内部。渲染局部液体布局(rails3)
请注意@current_page.page_layout.content
将从DB
我的液体布局文件如下
#layouts/public.html.erb
<%= Liquid::Template.parse(@current_page.page_layout.content).
render('page_content' => yield, 'page_title' => yield(:title)) %>
加载内容和以下是我的代码,其包括部分以及
{{page_content}}
{% include 'this_is_the_partial_name' %}
我得到这个错误
Liquid error: This liquid context does not allow includes.
我想谷歌和found this solution,但我仍然不知道在哪里/什么为这个代码
Liquid::Template.file_system =
Liquid::LocalFileSystem.new(template_path)
liquid = Liquid::Template.parse(template)
进入任何帮助,将不胜感激提前
该解决方案为我工作。 – 2015-03-25 15:36:56