Class: Atreides::PagesController

Inherits:
PublicController show all
Includes:
Extendable
Defined in:
app/controllers/atreides/pages_controller.rb

Instance Method Summary collapse

Instance Method Details

#previewObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/atreides/pages_controller.rb', line 9

def preview
  @page = end_of_association_chain.new(params[:page])
  @page.id ||= 0
  @page.published_at = 1.minute.ago
  @page.slug = 'preview' unless @page.slug?
  @body_classes = "page-show" # So that CSS will think it's the details page
  respond_to do |wants|
    wants.html {
      render :template => "atreides/pages/show"
    }
  end
end

#showObject



3
4
5
6
7
# File 'app/controllers/atreides/pages_controller.rb', line 3

def show
  track_resource_analytics
  @page_title = resource.title
  super
end