Module: Polymer::Rails::AssetTagHelper

Defined in:
lib/polymer-rails/helpers/asset_tag_helper.rb

Instance Method Summary collapse

Instance Method Details

#html_import_tag(*sources) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/polymer-rails/helpers/asset_tag_helper.rb', line 4

def html_import_tag(*sources)
  options = sources.extract_options!
  path_options = options.extract!('protocol').symbolize_keys
  sources.uniq.map do |source|
    tag_options = { rel: "import", href: path_to_asset(source, {type: :html, extname: '.html'}.merge!(path_options)) }
    tag(:link, tag_options.merge!(options).stringify_keys)
  end.join("\n").html_safe
end