Sha256: 513cf3e359089e0d296eae9d2c8d19a5a77b774a060988f9d5685898a74bd4e2
Contents?: true
Size: 584 Bytes
Versions: 13
Compression:
Stored size: 584 Bytes
Contents
module Locomotive module Concerns module RedirectToMainHostController extend ActiveSupport::Concern included do before_action :redirect_to_main_host end private def redirect_to_main_host return if Locomotive.config.host.blank? || request.env['locomotive.default_host'].present? if request.host != Locomotive.config.host options = { host: Locomotive.config.host } options[:port] = request.port if request.port != 80 redirect_to root_url(options) end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems