Sha256: 7cb779109389ff7fb299ea225b4875e72cff7adcbfb15ccdc2e0c4b3174d48da

Contents?: true

Size: 737 Bytes

Versions: 21

Compression:

Stored size: 737 Bytes

Contents

module Lookbook
  module ApplicationHelper
    def config
      Lookbook::Engine.config.lookbook
    end

    def theme
      Lookbook.theme
    end

    def asset_path(file, version: true)
      path = "/lookbook-assets/#{file}".gsub("//", "/")
      version ? "#{path}?v=#{Lookbook::VERSION}" : path
    end

    def feature_enabled?(name)
      Lookbook::Features.enabled?(name)
    end

    def landing_path
      landing = Lookbook.pages.find(&:landing) || Lookbook.pages.first
      if landing.present?
        lookbook_page_path landing.lookup_path
      else
        lookbook_home_path
      end
    end

    def generate_id(*args)
      args.map { |args| args.delete_prefix("/").tr("&?=/_\-", "-") }.join("-")
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lookbook-1.3.3 app/helpers/lookbook/application_helper.rb
lookbook-1.3.1 app/helpers/lookbook/application_helper.rb
lookbook-1.3.0 app/helpers/lookbook/application_helper.rb
lookbook-1.2.1 app/helpers/lookbook/application_helper.rb
lookbook-1.2.0 app/helpers/lookbook/application_helper.rb
lookbook-1.1.1 app/helpers/lookbook/application_helper.rb
lookbook-1.1.0 app/helpers/lookbook/application_helper.rb
lookbook-1.0.8 app/helpers/lookbook/application_helper.rb
lookbook-1.0.7 app/helpers/lookbook/application_helper.rb
lookbook-1.0.6 app/helpers/lookbook/application_helper.rb
lookbook-1.0.5 app/helpers/lookbook/application_helper.rb
lookbook-1.0.4 app/helpers/lookbook/application_helper.rb
lookbook-1.0.3 app/helpers/lookbook/application_helper.rb
lookbook-1.0.2 app/helpers/lookbook/application_helper.rb
lookbook-1.0.1 app/helpers/lookbook/application_helper.rb
lookbook-1.0.0 app/helpers/lookbook/application_helper.rb
lookbook-1.0.0.rc.3 app/helpers/lookbook/application_helper.rb
lookbook-1.0.0.rc.2 app/helpers/lookbook/application_helper.rb
lookbook-1.0.0.rc.1 app/helpers/lookbook/application_helper.rb
lookbook-1.0.0.beta.8 app/helpers/lookbook/application_helper.rb