Class: Comable::PagesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/comable/pages_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#set_view_path

Instance Method Details

#showObject



3
4
5
6
7
8
9
10
# File 'app/controllers/comable/pages_controller.rb', line 3

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