Module: PagesCore::PreviewPagesController

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

Instance Method Summary collapse

Instance Method Details

#previewObject


9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/concerns/pages_core/preview_pages_controller.rb', line 9

def preview
  redirect_to(page_url(@locale, @page)) && return unless logged_in?
  @page.attributes = page_params.merge(
    status: 2,
    published_at: Time.zone.now,
    locale: @locale,
    redirect_to: nil
  )
  render_page
end