Sha256: bfd4d18a89a4d635212c6cce38a1871e1c467ec79cbdfadd7a3d7c966a69fd80

Contents?: true

Size: 361 Bytes

Versions: 6

Compression:

Stored size: 361 Bytes

Contents

class PagesController < ApplicationController
  def show
    @site = Site.where(:domain => request.host).first || Site.first
    slug = params[:path].blank? ? '/' : params[:path]

    if @page = @site.pages.published.by_slug(slug).first
      render :layout => @site.layout
    else
      raise Mongoid::Errors::DocumentNotFound.new Page, slug
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
site_logic-1.9.13 app/controllers/pages_controller.rb
site_logic-1.9.12 app/controllers/pages_controller.rb
site_logic-1.9.11 app/controllers/pages_controller.rb
site_logic-1.9.10 app/controllers/pages_controller.rb
site_logic-1.9.9 app/controllers/pages_controller.rb
site_logic-1.9.8 app/controllers/pages_controller.rb