Sha256: 19636ccdeffd223c4662647d60efe4173b534e54f4525c08093fb2e711f377c6

Contents?: true

Size: 1.13 KB

Versions: 20

Compression:

Stored size: 1.13 KB

Contents

require 'rails'
require 'ckeditor'

module Ckeditor
  class Engine < ::Rails::Engine
    isolate_namespace Ckeditor

    initializer "ckeditor.assets_precompile", :group => :all do |app|
      app.config.assets.precompile += Ckeditor.assets
    end

    initializer "ckeditor.helpers" do
      ActiveSupport.on_load(:action_controller) do
        ActionController::Base.send :include, Ckeditor::Helpers::Controllers
      end

      ActiveSupport.on_load :action_view do
        ActionView::Base.send :include, Ckeditor::Helpers::ViewHelper
        ActionView::Base.send :include, Ckeditor::Helpers::FormHelper
        ActionView::Helpers::FormBuilder.send :include, Ckeditor::Helpers::FormBuilder
      end
    end

    initializer "ckeditor.hooks" do
      if Object.const_defined?("Formtastic")
        require "ckeditor/hooks/formtastic"
      end

      if Object.const_defined?("SimpleForm")
        require "ckeditor/hooks/simple_form"
      end

      if Object.const_defined?("CanCan")
        require "ckeditor/hooks/cancan"
      end

      if Object.const_defined?("Pundit")
        require "ckeditor/hooks/pundit"
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
glebtv-ckeditor-4.4.7.4 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.7.3 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.7.2 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.7.1 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.7 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.6 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.3.4 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.3.3 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.3.2 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.3.1 lib/ckeditor/engine.rb
glebtv-ckeditor-4.4.3.0 lib/ckeditor/engine.rb
glebtv-ckeditor-4.3.2.6 lib/ckeditor/engine.rb
glebtv-ckeditor-4.3.2.5 lib/ckeditor/engine.rb
ckeditor-4.0.11 lib/ckeditor/engine.rb
glebtv-ckeditor-4.3.2.4 lib/ckeditor/engine.rb
glebtv-ckeditor-4.3.2.3 lib/ckeditor/engine.rb
glebtv-ckeditor-4.3.2.2 lib/ckeditor/engine.rb
glebtv-ckeditor-4.3.2.1 lib/ckeditor/engine.rb
glebtv-ckeditor-4.3.2.0 lib/ckeditor/engine.rb
ckeditor-4.0.10 lib/ckeditor/engine.rb