Sha256: fa411b61705347ee3741ac44fee2b889a9b4d98e6b6ee6b7801c7db61eed4ebd
Contents?: true
Size: 927 Bytes
Versions: 10
Compression:
Stored size: 927 Bytes
Contents
module Cms module Fortress module ContentRenderer def self.included(base) base.class_eval do def render_html(status = 200) cached_timeout = @cms_page.cached_timeout.to_i if cached_timeout > 0 fresh_when etag: @cms_page, last_modified: @cms_page.updated_at.utc, public: true response.cache_control[:max_age] = cached_timeout.seconds end if @cms_layout = @cms_page.layout app_layout = (@cms_layout.app_layout.blank? || request.xhr?) ? false : @cms_layout.app_layout render(:inline => @cms_page.content, :layout => app_layout, :status => status, :content_type => 'text/html') unless cached_timeout > 0 && performed? else render :text => I18n.t('cms.content.layout_not_found'), :status => 404 end end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems