Sha256: b57d1f05fff3e30fc35b38eecaa112324be1d478de200084ba1be3c87b067062

Contents?: true

Size: 482 Bytes

Versions: 1

Compression:

Stored size: 482 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slightcms-0.0.11 lib/app/controller/slightcms/pages_controller.rb