Module: Munge::Helper::AssetTags

Defined in:
lib/munge/helper/asset_tags.rb

Instance Method Summary collapse

Instance Method Details

#image_tag(basename, options = {}) ⇒ Object



18
19
20
21
22
# File 'lib/munge/helper/asset_tags.rb', line 18

def image_tag(basename, options = {})
  options[:src] ||= image_path(basename)

  empty_tag(:img, options)
end

#inline_javascript_tag(basename, options = {}) ⇒ Object



28
29
30
# File 'lib/munge/helper/asset_tags.rb', line 28

def inline_javascript_tag(basename, options = {})
  inline_asset_tag_helper(javascripts_root, basename, :script, options)
end

#inline_stylesheet_tag(basename, options = {}) ⇒ Object



24
25
26
# File 'lib/munge/helper/asset_tags.rb', line 24

def inline_stylesheet_tag(basename, options = {})
  inline_asset_tag_helper(stylesheets_root, basename, :style, options)
end

#javascript_tag(basename, options = {}) ⇒ Object



11
12
13
14
15
16
# File 'lib/munge/helper/asset_tags.rb', line 11

def javascript_tag(basename, options = {})
  options[:type] ||= "text/javascript"
  options[:src] ||= javascript_path(basename)

  (:script, options)
end

#stylesheet_tag(basename, options = {}) ⇒ Object



4
5
6
7
8
9
# File 'lib/munge/helper/asset_tags.rb', line 4

def stylesheet_tag(basename, options = {})
  options[:rel] ||= "stylesheet"
  options[:href] ||= stylesheet_path(basename)

  empty_tag(:link, options)
end