Sha256: cecf333a9bac7ddb044a0590eeee0ef3697c1059836108333975a30fbf0571d4

Contents?: true

Size: 389 Bytes

Versions: 3

Compression:

Stored size: 389 Bytes

Contents

module EmberCli
  module ControllerExtension
    def self.included(base)
      build_ember_app = lambda do
        app = params[:ember_app]

        if app.present?
          EmberCli[app].build
        end
      end

      if base.respond_to?(:before_action)
        base.before_action(&build_ember_app)
      else
        base.before_filter(&build_ember_app)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ember-cli-rails-0.5.8 lib/ember_cli/controller_extension.rb
ember-cli-rails-0.5.7 lib/ember_cli/controller_extension.rb
ember-cli-rails-0.5.6 lib/ember_cli/controller_extension.rb