Sha256: 2961cf85828fa950567750f4612a4e928abf157831b16b410e2ca0200eec7cfa

Contents?: true

Size: 561 Bytes

Versions: 11

Compression:

Stored size: 561 Bytes

Contents

require_dependency "front_end_builds/application_controller"

module FrontEndBuilds
  class AdminController < ApplicationController

    def index
      # We need to pass the url which the host app has mounted the
      # engine to into index.html.erb, so the ember app's router
      # will work appropriately.

      # Trim trailing slash marks
      baseURL = admin_path[1..-2]

      html = render_to_string
      html = html.sub('BASEURL/', baseURL)
      html = html.sub("baseURL: ''", "baseURL: '#{baseURL}'")

      render text: html
    end

  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
front_end_builds-0.2.1 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.2.0 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.1.3 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.1.2 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.1.1 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.1.0 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.0.26 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.0.25 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.0.24 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.0.23 app/controllers/front_end_builds/admin_controller.rb
front_end_builds-0.0.21 app/controllers/front_end_builds/admin_controller.rb