Sha256: 64ca149d568832dcdbc678383e87f95bf0ed71e5c65b23db49c2479c4568d90f
Contents?: true
Size: 544 Bytes
Versions: 2
Compression:
Stored size: 544 Bytes
Contents
class PagesController < Forgeos::ApplicationController before_filter :get_page, :only => [ :show ] caches_page :show, :if => :get_page def index if @page = Page.find_by_single_key('home') redirect_to(@page) else page_not_found end end def show return page_not_found unless @page end private def get_page url = params[:url].last.gsub(/\.\w+$/,'') @format = params[:url].last.split('.').last || request.format @page = Page.find_by_url(url, :conditions => { :active => true }) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
forgeos_cms-1.9.4 | app/controllers/pages_controller.rb |
forgeos_cms-1.9.2 | app/controllers/pages_controller.rb |