Add liquid template render
This commit is contained in:
parent
66604d00f4
commit
78e8c32969
|
@ -4,7 +4,7 @@ class PagesController < ApplicationController
|
||||||
@page = Page.find_by_name(params[:page_name])
|
@page = Page.find_by_name(params[:page_name])
|
||||||
|
|
||||||
if @page
|
if @page
|
||||||
render :text => @page.content
|
render :text => Liquid::Template.parse(@page.content).render
|
||||||
else
|
else
|
||||||
render :text => '404 not found'
|
render :text => '404 not found'
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= f.label :content, "Content" %>
|
<%= f.label :content, "Content" %>
|
||||||
<%= f.text_area :content %>
|
<%= f.text_area :content, :size => '100x30' %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<%= f.label :content, "Content" %>
|
<%= f.label :content, "Content" %>
|
||||||
<%= f.text_area :content %>
|
<%= f.text_area :content, :size => '100x30' %>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -38,6 +38,7 @@ Rails::Initializer.run do |config|
|
||||||
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
||||||
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
|
||||||
# config.i18n.default_locale = :de
|
# config.i18n.default_locale = :de
|
||||||
|
config.gem "liquid"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Reference in New Issue