Sha256: ddadc88bf3aaaa930cda04399bfc627133558b131465b039781ee0164dd301a5

Contents?: true

Size: 787 Bytes

Versions: 5

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

5 entries across 5 versions & 1 rubygems

Version Path
ember-cli-rails-0.5.6 app/helpers/ember_rails_helper.rb
ember-cli-rails-0.5.5 app/helpers/ember_rails_helper.rb
ember-cli-rails-0.5.4 app/helpers/ember_rails_helper.rb
ember-cli-rails-0.5.3 app/helpers/ember_rails_helper.rb
ember-cli-rails-0.5.2 app/helpers/ember_rails_helper.rb