Sha256: 7b5f9ef37ce2a58bc6056e4eff497631e35623ecbebebd4e30c1d0a15a9c2e51

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 Bytes

Contents

class EmberTestsController < ActionController::Base
  def index
    render text: test_html_with_corrected_asset_urls, layout: false
  end

  private

  def test_html_with_corrected_asset_urls
    test_html.gsub(%r{assets/}i, "#{asset_prefix}/#{app_name}/")
  end

  def test_html
    tests_index_path.read
  end

  def tests_index_path
    app.tests_path.join("index.html")
  end

  def app
    EmberCli[app_name]
  end

  def app_name
    params.fetch(:app_name)
  end

  def asset_prefix
    Rails.configuration.assets.prefix
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ember-cli-rails-0.4.3 app/controllers/ember_tests_controller.rb
ember-cli-rails-0.4.2 app/controllers/ember_tests_controller.rb