Sha256: 8fc0de963c42a89078c0ea10bb74cb7483249b18b76b7cb9815dddee31493bc6

Contents?: true

Size: 709 Bytes

Versions: 10

Compression:

Stored size: 709 Bytes

Contents

# frozen_string_literal: true

module PagesCore
  class BaseController < ActionController::Base
    include PagesCore::Authentication
    include PagesCore::ErrorRenderer
    include PagesCore::ErrorReporting
    include PagesCore::LocalesHelper
    include PagesCore::ProcessTitler
    include PagesCore::PoliciesHelper
    include PagesCore::StaticCacheController

    after_action :set_content_language_header

    protected

    def append_info_to_payload(payload)
      super
      payload[:remote_ip] = request.remote_ip
      payload.merge!(current_user_context)
    end

    def set_content_language_header
      return unless locale

      headers["Content-Language"] = locale.to_s
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pages_core-3.15.5 app/controllers/pages_core/base_controller.rb
pages_core-3.15.4 app/controllers/pages_core/base_controller.rb
pages_core-3.15.3 app/controllers/pages_core/base_controller.rb
pages_core-3.15.2 app/controllers/pages_core/base_controller.rb
pages_core-3.15.1 app/controllers/pages_core/base_controller.rb
pages_core-3.14.0 app/controllers/pages_core/base_controller.rb
pages_core-3.13.0 app/controllers/pages_core/base_controller.rb
pages_core-3.12.7 app/controllers/pages_core/base_controller.rb
pages_core-3.12.6 app/controllers/pages_core/base_controller.rb
pages_core-3.12.5 app/controllers/pages_core/base_controller.rb