Add liquid template render

This commit is contained in:
Wen-Tien Chang 2009-05-08 01:32:49 +08:00
parent 66604d00f4
commit 78e8c32969
4 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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>

View File

@ -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>

View File

@ -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