Sha256: faa0d211f1d8bfbd1d43d21b0ef563a01f7fcd86b9b0b1d7b9d771bbe0f2d2d7
Contents?: true
Size: 803 Bytes
Versions: 8
Compression:
Stored size: 803 Bytes
Contents
class Comfy::Cms::BaseController < ApplicationController before_action :load_cms_site protected def load_cms_site @cms_site ||= if params[:site_id] ::Comfy::Cms::Site.find_by_id(params[:site_id]) else ::Comfy::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] && params[:cms_path].match(%r{\A#{@cms_site.path}}) params[:cms_path].gsub!(%r{\A#{@cms_site.path}}, "") params[:cms_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
8 entries across 8 versions & 1 rubygems