Module: PagesCore::PreviewPagesController

Extended by:
ActiveSupport::Concern
Includes:
PageParameters
Included in:
Frontend::PagesController
Defined in:
app/controllers/concerns/pages_core/preview_pages_controller.rb

Instance Method Summary collapse

Methods included from PageParameters

#page_attachment_attributes, #page_content_attributes, #page_static_attributes

Instance Method Details

#previewObject



16
17
18
19
20
21
22
23
24
25
# File 'app/controllers/concerns/pages_core/preview_pages_controller.rb', line 16

def preview
  render_error 403 unless logged_in?

  @preview = true
  @page = Page.find_by(id: params[:page_id]) || Page.new
  @page.readonly!
  @page.assign_attributes(preview_page_params)

  render_page
end

#preview?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/controllers/concerns/pages_core/preview_pages_controller.rb', line 12

def preview?
  @preview || false
end