Module: Stapler::Rails::RailsHelper

Defined in:
lib/stapler/rails.rb

Instance Method Summary collapse

Instance Method Details

#javascript_include_tag(*sources) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/stapler/rails.rb', line 31

def javascript_include_tag(*sources)
  options = sources.extract_options!.stringify_keys

  if options.delete('cache') || options.delete('concat')
    recursive = options.delete('recursive')
    paths = compute_javascript_paths(sources, recursive)
    javascript_src_tag(Utils.bundle_path(paths), options)
  else
    sources << options
    super(*sources)
  end
end


44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/stapler/rails.rb', line 44

def stylesheet_link_tag(*sources)
  options = sources.extract_options!.stringify_keys

  if options.delete('cache') || options.delete('concat')
    recursive = options.delete('recursive')
    paths = compute_stylesheet_paths(sources, recursive)
    stylesheet_tag(Utils.bundle_path(paths), options)
  else
    sources << options
    super(*sources)
  end
end