Module: Lesli::AssetsHelper

Defined in:
app/helpers/lesli/assets_helper.rb

Instance Method Summary collapse

Instance Method Details

#faviconObject



64
65
66
67
68
69
70
71
72
# File 'app/helpers/lesli/assets_helper.rb', line 64

def favicon
    icon_path = customization_instance_logo_url(logo: "favicon")

    safe_join([
        tag.link(href: icon_path, rel: "alternate icon"),
        tag.link(href: icon_path, rel: "icon", type: "image/svg+xml"),
        tag.link(href: icon_path, rel: "mask-icon", color: "#ff8a01")
    ])
end

#lesli_asset_path(engine = nil, stylesheet = 'application') ⇒ Object

Return a string path to load the template stylesheet by default we always return the latest version of the template

stylesheet from main App lesli_asset_path()

/assets/application.css

Specific stylesheet from Engine lesli_asset_path(:lesli, ‘application’) /assets/lesli/application.css

Specific stylesheet from gem lesli_asset_path(:lesli_assets, ‘templates/application’) /assets/lesli_assets/templates/application.css



49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'app/helpers/lesli/assets_helper.rb', line 49

def lesli_asset_path(engine = nil, stylesheet = 'application')

    # Stylesheets from specific engine
    return "#{engine}/#{stylesheet}" if engine.present?

    # Get current engine information
    engine_code = lesli_engine(:code)

    # Rails main host app stylesheets
    return 'application' if engine_code == 'root'

    # Rails engines stylesheets
    "#{engine_code}/#{stylesheet}"
end