【发布时间】:2013-02-11 18:45:57
【问题描述】:
我有一个液体模板,我需要在其中渲染一部分。
请注意@current_page.page_layout.content 将从数据库中加载内容。
我的液体布局文件如下:
#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)
【问题讨论】:
标签: ruby-on-rails-3 layout partial liquid