Module: Fronton::Contexts::Sprockets

Defined in:
lib/fronton/contexts/sprockets.rb

Instance Method Summary collapse

Instance Method Details

#asset_path(path, _options = {}) ⇒ Object Also known as: asset-path



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/fronton/contexts/sprockets.rb', line 9

def asset_path(path, _options = {})
  asset = link_asset(path)
  digest_path = asset.digest_path
  path = digest_path if config.use_digest

  if current_prefix.empty?
    path
  else
    "#{current_prefix}/#{path}"
  end
end

#asset_url(path, _options = {}) ⇒ Object Also known as: asset-url



4
5
6
# File 'lib/fronton/contexts/sprockets.rb', line 4

def asset_url(path, _options = {})
  "url(#{asset_path(path)})"
end