Sha256: f526cfe80b2142daf40cdb3f0cf11f345edf4bbb307611af66522fa66bd6e2a0
Contents?: true
Size: 855 Bytes
Versions: 1
Compression:
Stored size: 855 Bytes
Contents
# frozen_string_literal: true class Occams::Cms::BaseController < Occams.config.public_base_controller.to_s.constantize before_action :load_cms_site helper Occams::CmsHelper protected def load_cms_site @cms_site ||= if params[:site_id] ::Occams::Cms::Site.find_by_id(params[:site_id]) else ::Occams::Cms::Site.find_site(request.host_with_port.downcase, request.fullpath) end if @cms_site if @cms_site.path.present? && !params[:site_id] if params[:cms_path]&.match(%r{\A#{@cms_site.path}}) params[:cms_path].gsub!(%r{\A#{@cms_site.path}}, "") params[:cms_path]&.gsub!(%r{\A/}, "") else raise ActionController::RoutingError, "Site Not Found" end end else raise ActionController::RoutingError, "Site Not Found" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
occams-1.0.1 | app/controllers/occams/cms/base_controller.rb |