Sha256: 02d68b7c97842ee84c11db9ba8ba40c036ce4388cadfbe3ffe7126b750e739ad
Contents?: true
Size: 876 Bytes
Versions: 9
Compression:
Stored size: 876 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(/\A#{@cms_site.path}/) params[:cms_path].gsub!(/\A#{@cms_site.path}/, '') params[:cms_path] && params[:cms_path].gsub!(/\A\//, '') else raise ActionController::RoutingError.new('Site Not Found') end end I18n.locale = @cms_site.locale else I18n.locale = I18n.default_locale raise ActionController::RoutingError.new('Site Not Found') end end end
Version data entries
9 entries across 9 versions & 1 rubygems