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

25 lines
473 B
Ruby

class PagesController < ApplicationController
def index
@page = Home.find_by_name('home')
if @page
render_liquid_page
else
render :text => 'You need a home page'
end
end
def show
item = Item.first(:conditions => {:full_name => params[:page_name]})
case item._type
when 'Page'
@page = item
render_liquid_page
when 'Link'
redirect_to "http://#{item[:url]}"
end
end
end