Sha256: b5ff492abbfdd50e76f0ea0a7f3a861df035e399a5d247e2006f45e1f06dd6f4

Contents?: true

Size: 587 Bytes

Versions: 7

Compression:

Stored size: 587 Bytes

Contents

require "ember_cli/constraint"

module ActionDispatch
  module Routing
    class Mapper
      def mount_ember_app(app_name, to:, **options)
        routing_options = options.deep_merge(
          defaults: { ember_app: app_name },
        )

        routing_options.reverse_merge!(
          controller: "ember_cli/ember",
          action: "index",
          format: :html,
        )

        Rails.application.routes.draw do
          scope constraints: EmberCli::Constraint.new do
            get("#{to}(*rest)", routing_options)
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ember-cli-rails-0.5.8 lib/ember_cli/route_helpers.rb
ember-cli-rails-0.5.7 lib/ember_cli/route_helpers.rb
ember-cli-rails-0.5.6 lib/ember_cli/route_helpers.rb
ember-cli-rails-0.5.5 lib/ember_cli/route_helpers.rb
ember-cli-rails-0.5.4 lib/ember_cli/route_helpers.rb
ember-cli-rails-0.5.3 lib/ember_cli/route_helpers.rb
ember-cli-rails-0.5.2 lib/ember_cli/route_helpers.rb