Sha256: 8074e9970964fc9edeac72511647f15128c977137a8c3152cc84b58a24b7673c
Contents?: true
Size: 1004 Bytes
Versions: 7
Compression:
Stored size: 1004 Bytes
Contents
class Comfy::Cms::AssetsController < Comfy::Cms::BaseController skip_before_action :verify_authenticity_token before_action :load_cms_layout, :use_null_session after_action :set_cache_control_header def render_css render :text => @cms_layout.css, :content_type => 'text/css' end def render_js render :text => @cms_layout.js, :content_type => 'application/javascript' end protected def load_cms_layout @cms_layout = @cms_site.layouts.find_by_identifier!(params[:identifier]) rescue ActiveRecord::RecordNotFound render :nothing => true, :status => 404 end # null_session avoids cookies and flash updates def use_null_session ActionController::RequestForgeryProtection::ProtectionMethods::NullSession.new(self) .handle_unverified_request end def set_cache_control_header if params[:cache_buster].present? response.headers['Cache-Control'] = "public, max-age=#{1.year.to_i}" end end end
Version data entries
7 entries across 7 versions & 1 rubygems