Module: PagesCore::PreviewPagesController
Instance Method Summary
collapse
#page_attachment_attributes, #page_content_attributes, #page_static_attributes
Instance Method Details
#preview ⇒ Object
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
12
13
14
|
# File 'app/controllers/concerns/pages_core/preview_pages_controller.rb', line 12
def preview?
@preview || false
end
|