Sha256: d55d55cedded5636717ad1db160ac71a3a1672b35454de99215b26e8117415be

Contents?: true

Size: 1.06 KB

Versions: 10

Compression:

Stored size: 1.06 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
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
ckeditor-4.0.8 lib/ckeditor/engine.rb
base2_ckeditor-4.0.7 lib/ckeditor/engine.rb
ckeditor-4.0.7 lib/ckeditor/engine.rb
ckeditor-4.0.6 lib/ckeditor/engine.rb
ckeditor-4.0.4 lib/ckeditor/engine.rb
ckeditor-4.0.2 lib/ckeditor/engine.rb
ckeditor-4.0.1 lib/ckeditor/engine.rb
ckeditor-4.0.0 lib/ckeditor/engine.rb
ckeditor-4.0.0.rc2 lib/ckeditor/engine.rb
ckeditor-4.0.0.rc1 lib/ckeditor/engine.rb