Sha256: 96fa3f2ff6e8dd9f92226319a5bf786369a5092550fb807f77dca2c35f33a541

Contents?: true

Size: 787 Bytes

Versions: 2

Compression:

Stored size: 787 Bytes

Contents

require "ember-cli/capture"

module EmberRailsHelper
  def include_ember_index_html(name, &block)
    warn <<-MSG.strip_heredoc
      The `include_ember_index_html` helper has been deprecated.

      Rename all invocations to `render_ember_app`
    MSG

    render_ember_app(name, &block)
  end

  def render_ember_app(name, &block)
    markup_capturer = EmberCli::Capture.new(sprockets: self, &block)

    head, body = markup_capturer.capture

    render inline: EmberCli[name].sprockets.index_html(head: head, body: body)
  end

  def include_ember_script_tags(name, **options)
    javascript_include_tag(*EmberCli[name].sprockets.assets, options)
  end

  def include_ember_stylesheet_tags(name, **options)
    stylesheet_link_tag(*EmberCli[name].sprockets.assets, options)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ember-cli-rails-0.5.1 app/helpers/ember_rails_helper.rb
ember-cli-rails-0.5.0 app/helpers/ember_rails_helper.rb