orbit-basic/app/controllers/pages_controller.rb

20 lines
532 B
Ruby
Raw Normal View History

class PagesController < ApplicationController
Liquid::Template.register_filter(SnippetFilter)
def show
@page = Page.find_by_name(params[:page_name])
2009-05-07 17:54:33 +00:00
@layout = @page.layout
if @page
2009-05-07 17:54:33 +00:00
@page_content = Liquid::Template.parse(@page.content).render
@layout_content = (@page.layout)? @layout.content : "{{page_content}}"
render :text => Liquid::Template.parse(@layout_content).render( 'page_content' => @page_content )
else
render :text => '404 not found'
end
end
end