Sha256: 7fd8799e492f00a80c85057f2290186c1f7751aa10c3eecd19552ca23c061689

Contents?: true

Size: 1.26 KB

Versions: 25

Compression:

Stored size: 1.26 KB

Contents

# frozen_string_literal: true

module App
  # AppController -> Controller out the back-office
  class AppController < ::ApplicationController
    layout 'app/layouts/application'
    skip_before_action :verify_authenticity_token
    before_action :set_metas
    before_action :set_analytics

    def set_metas
      @theme_color = nil
      # Descomentar el modelo que exista depende del proyecto
      # @post = KepplerBlog::Post.find(params[:id])
      # @product = Product.find(params[:id])
      @setting = Setting.first
      @meta = MetaTag.get_by_url(request.url)
      @social = SocialAccount.last
      @meta_title = MetaTag.title(@post, @product, @setting)
      @meta_description = MetaTag.description(@post, @product, @setting)
      @meta_image = MetaTag.image(request, @post, @product, @setting)
      @meta_locale = @locale.eql?('es') ? 'es_VE' : 'en_US'
      @meta_locale_alternate = @locale.eql?('es') ? 'en_US' : 'es_VE'
      @country_code = @locale.eql?('es') ? 'VE' : 'US'
    end

    private

    def default_url_options(options = {})
      logger.debug "default_url_options is passed options: #{options.inspect}\n"
      { locale: I18n.locale }
    end

    def set_analytics
      @scripts = Script.select { |x| x.url == request.env['PATH_INFO'] }
    end
  end
end

Version data entries

25 entries across 24 versions & 1 rubygems

Version Path
keppler-2.1.22 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.21 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.20 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.19 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.18 testing-with-2.1.18/app/controllers/app/app_controller.rb
keppler-2.1.18 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.17 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.16 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.15 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.14 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.13 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.12 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.11 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.10 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.9 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.8 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.7 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.6 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.5 installer/core/app/controllers/app/app_controller.rb
keppler-2.1.4 installer/core/app/controllers/app/app_controller.rb