This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/app/controllers/pages_controller.rb

27 lines
563 B
Ruby
Raw Normal View History

class PagesController < ApplicationController
def index
2009-06-01 06:52:37 +00:00
@page = Page.find_by_name('root')
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])
2009-06-01 02:54:16 +00:00
if @page && !@page.external_link.blank?
2009-05-22 06:51:32 +00:00
redirect_to @page.external_link
2009-06-01 02:54:16 +00:00
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