Sha256: fc36bb5da3c81bbdbeae0e30b798e1c755ec2a37c1506a3be8741f5a7e5426a0

Contents?: true

Size: 464 Bytes

Versions: 1

Compression:

Stored size: 464 Bytes

Contents

module Landable
  class PageRenderResponder < ActionController::Responder
    def to_html
      page = resource

      case page.status_code
      when 200 then render text: RenderService.call(page, preview: options[:preview], responder: self), content_type: page.content_type, layout: (page.theme.try(:file) || false)
      when 301, 302 then redirect_to page.redirect_url, status: page.status_code
      else          fail page.error
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
landable-1.14.0 app/responders/landable/page_render_responder.rb