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