Sha256: a19a09b3e99aab22f97ea81e19e4c184ea9432ec02e1bd4699df3acd08786542

Contents?: true

Size: 661 Bytes

Versions: 4

Compression:

Stored size: 661 Bytes

Contents

module Enlightenment
  class AssetsController < Enlightenment::ApplicationController
    respond_to :js

    def show
      super({
        :layout => false,
        :locals => {
          :config => validate_config,
          :models => validate_models
        },
        :formats => [:js]
      })
    end

    private

      # handle deprecation warning.
      def path
        super.sub(/\.js$/, '')
      end

      def validate_config
        config = Enlightenment.validate_config
        config.present? ? config.to_json : nil
      end

      def validate_models
        Enlightenment::Rules.generate(Enlightenment.validate_models)
      end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enlightenment-0.0.1.pre.4 app/controllers/enlightenment/assets_controller.rb
enlightenment-0.0.1.pre.3 app/controllers/enlightenment/assets_controller.rb
enlightenment-0.0.1.pre.2 app/controllers/enlightenment/assets_controller.rb
enlightenment-0.0.1.pre.1 app/controllers/enlightenment/assets_controller.rb