Sha256: 5c2552ed9162ed1a39ba97eb5fe125156b3f877689913772a38ef4d44af4ce16

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 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

1 entries across 1 versions & 1 rubygems

Version Path
lookbook-1.3.4 app/helpers/lookbook/application_helper.rb