module Slightcms class PagesController < ApplicationController # Render a page by its full path def show @page = Slightcms::Page.find_by_path(params[:path]) if @page.nil? flash[:error] = "The site you are looking for doesn't exist!" render_404 return else @page_content = @page.render_content end end end # Render a 404 error page def render_404 render :status => "404" end end