orbit-basic/app/controllers/pages_controller.rb

27 lines
563 B
Ruby

class PagesController < ApplicationController
def index
@page = Page.find_by_name('home')
if @page
render_liquid_page
else
render :text => 'You need a home page'
end
end
def show
@page = Page.find_by_name(params[:page_name])
if @page && !@page.external_link.blank?
redirect_to @page.external_link
elsif @page && @page.use_engine
#model_class = Kernel.const_get( "Announcement" ) # page.use_engine
redirect_to announcements_path
else
render_liquid_page
end
end
end