Sha256: 54133a9c993bd4078019be8cadd782ceb036f9ef9a34be9a84fe67e43ff0267b
Contents?: true
Size: 1.02 KB
Versions: 13
Compression:
Stored size: 1.02 KB
Contents
class Ecm::Cms::PageController < Ecm::Cms::Configuration.base_controller.constantize # add the page resolver include Ecm::Cms::ControllerExtensions::PageResolver include Ecm::Cms::ControllerExtensions::PartialResolver # avoid error 500 on missing template rescue_from ActionView::MissingTemplate do respond_to do |format| format.html do render(file: "#{Rails.root}/public/404", formats: [:html], layout: false, status: 404 ) end format.xml { head :not_found } format.any { head :not_found } end end def respond respond_to do |format| format.html { render template: params[:page] } format.txt { render template: params[:page], layout: false, formats: [:text] } format.pdf do output = render_to_string template: params[:page], formats: [:html, :pdf], layout: false self.response_body = WickedPdf.new.pdf_from_string(output) end if Gem::Specification.find_all_by_name('wicked_pdf').any? end end end
Version data entries
13 entries across 13 versions & 1 rubygems