Module: EmberCliRailsAssetsHelper

Defined in:
app/helpers/ember_cli_rails_assets_helper.rb

Instance Method Summary collapse

Instance Method Details

#include_ember_script_tags(name, prepend: "") ⇒ Object



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

def include_ember_script_tags(name, prepend: "")
  EmberCli[name].build

  assets = EmberCli::Assets::Lookup.new(EmberCli[name])

  assets.javascript_assets.
    map { |src| [prepend, src].join }.
    map { |src| %{<script src="#{src}"></script>}.html_safe }.
    inject(&:+)
end

#include_ember_stylesheet_tags(name, prepend: "") ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/ember_cli_rails_assets_helper.rb', line 15

def include_ember_stylesheet_tags(name, prepend: "")
  EmberCli[name].build

  assets = EmberCli::Assets::Lookup.new(EmberCli[name])

  assets.stylesheet_assets.
    map { |src| [prepend, src].join }.
    map { |src| %{<link rel="stylesheet" href="#{src}">}.html_safe }.
    inject(&:+)
end