Sha256: ba4d05c27116bc20cfe2e33a2a5d5692712a3043c8685aeeed197de524b958e4

Contents?: true

Size: 933 Bytes

Versions: 4

Compression:

Stored size: 933 Bytes

Contents

require "rails_kindeditor"
require "rails"
require "action_controller"

module RailsKindeditor
  class Engine < Rails::Engine
    
    initializer "rails_kindeditor.assets_precompile" do |app|
      app.config.assets.precompile += RailsKindeditor.assets
    end
    
    initializer "rails_kindeditor.methods" do
      ActionController::Base.send(:include, RailsKindeditor::ControllerAdditions)
    end
    
    initializer "rails_kindeditor.simple_form_and_formtastic" do
      require "rails_kindeditor/simple_form" if Object.const_defined?("SimpleForm")
      require "rails_kindeditor/formtastic" if Object.const_defined?("Formtastic")
    end
    
    initializer "rails_kindeditor.helper_and_builder" do
      ActiveSupport.on_load :action_view do
        ActionView::Base.send(:include, RailsKindeditor::Helper)
        ActionView::Helpers::FormBuilder.send(:include, RailsKindeditor::Builder)
      end
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rails_kindeditor-0.3.6 lib/rails_kindeditor/engine.rb
rails_kindeditor-0.3.5 lib/rails_kindeditor/engine.rb
rails_kindeditor-0.3.4 lib/rails_kindeditor/engine.rb
rails_kindeditor-0.3.3 lib/rails_kindeditor/engine.rb