Method: Rails::Application#asset_precompiled?

Defined in:
lib/sprockets/railtie.rb

#asset_precompiled?(logical_path) ⇒ Boolean

Called from asset helpers to alert you if you reference an asset URL that isn’t precompiled and hence won’t be available in production.

Returns:

  • (Boolean)

38
39
40
41
42
43
44
45
46
47
# File 'lib/sprockets/railtie.rb', line 38

def asset_precompiled?(logical_path)
  if precompiled_assets.include?(logical_path)
    true
  elsif !config.cache_classes
    # Check to see if precompile list has been updated
    precompiled_assets(true).include?(logical_path)
  else
    false
  end
end