class PagesController < ApplicationController caches_page :show def show @page = Page.find_by_url('/' + params[:path].join('/')) if @page.blank? @page = Page.new @page.title = "We couldn't find that page" @page.body = "We weren't able to find the page you were looking for." render :status => 404, :layout => 'application' end end end