Module: CesspitRails::AssetHelpers

Defined in:
lib/cesspit_rails/asset_helpers.rb

Defined Under Namespace

Classes: AssetNotFound

Instance Method Summary collapse

Instance Method Details

#add_asset(path) ⇒ Object

Raises:



13
14
15
16
17
18
# File 'lib/cesspit_rails/asset_helpers.rb', line 13

def add_asset(path)
  asset = assets[path]
  raise AssetNotFound, path unless asset

  add_css(asset.to_s, path)
end

#assetsObject



27
28
29
# File 'lib/cesspit_rails/asset_helpers.rb', line 27

def assets
  Rails.application.assets
end

#read_css(path) ⇒ Object

Override the default read_html method.



21
22
23
24
25
# File 'lib/cesspit_rails/asset_helpers.rb', line 21

def read_css(path)
  add_asset(path)
rescue AssetNotFound => ex
  super(path)
end