Sha256: 102fc21023abcddf6502582f7ce92b8edfd5ae57f79665f3c00838eb216bda6e

Contents?: true

Size: 992 Bytes

Versions: 13

Compression:

Stored size: 992 Bytes

Contents

module QuicCms
  class PagesController < ApplicationController
    def show
      if params[:permalink]
        @page = Page.find_by_permalink(params[:permalink])
        if @page.nil?
          @page = Page.new(:title => "Page with permalink of #{params[:permalink]} does not exist",
                           :content => "If you are an Admin Please <a href='/users/sign_in'> Log in </a>and create it",
                           :permalink => params[:permalink], @show_title => true)
        end
      else
        @page = Page.find(params[:id])
      end
    end

    def index
      @page = Page.find_by_permalink("home")
      if @page.nil?
        @page = Page.new(:title => "Page with permalink of #{params[:permalink]} does not exist",
                         :content => "If you are an Admin Please <a href='/users/sign_in'> Log in </a>and create it",
                         :permalink => params[:permalink], @show_title => true)
      end
      render 'show'
    end

  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
quic_cms-0.1.4 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.1.3 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.1.2 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.1.1 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.1.0 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.9 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.8 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.7 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.6 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.5 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.4 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.3 app/controllers/quic_cms/pages_controller.rb
quic_cms-0.0.2 app/controllers/quic_cms/pages_controller.rb