Sha256: dec4682ba3f33120309ec0ecf0bfb617d591bec8c22a71674b57df8885441b87
Contents?: true
Size: 510 Bytes
Versions: 6
Compression:
Stored size: 510 Bytes
Contents
module Comable class PagesController < Comable::ApplicationController def show if Rails::VERSION::MAJOR == 3 @page = Comable::Page.find(params[:id]) else @page = Comable::Page.friendly.find(params[:id]) end fail ActiveRecord::RecordNotFound unless @page && (@page.published? || preview?) end private def preview? session[Comable::Page::PREVIEW_SESSION_KEY] ||= {} session[Comable::Page::PREVIEW_SESSION_KEY][@page.slug] end end end
Version data entries
6 entries across 6 versions & 2 rubygems