Module: DynamicAssetsHelpers

Defined in:
app/helpers/dynamic_assets_helpers.rb

Instance Method Summary collapse

Instance Method Details

#javascript_asset_tag(group_key, options = {}) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
# File 'app/helpers/dynamic_assets_helpers.rb', line 18

def javascript_asset_tag(group_key, options = {})
  html_options, path_options = separate_options(options)
  DynamicAssets::Manager.asset_references_for_group_key(:javascripts, group_key).map do |asset_ref|

     :script, "", {
      :type => "text/javascript",
      :src  => asset_url(asset_ref, path_options)
    }.merge!(html_options)

  end.join.html_safe
end

#stylesheet_asset_tag(group_key, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/dynamic_assets_helpers.rb', line 4

def stylesheet_asset_tag(group_key, options = {})
  html_options, path_options = separate_options(options)
  DynamicAssets::Manager.asset_references_for_group_key(:stylesheets, group_key).map do |asset_ref|

    tag :link, {
      :type   => "text/css",
      :rel    => "stylesheet",
      :media  => "screen",
      :href   => asset_url(asset_ref, path_options)
    }.merge!(html_options)

  end.join.html_safe
end