Sha256: 3dc3a2e36eb4e67df09230ac8fd8bdf9c6c32fea8950b971ab2ccff190a2749a

Contents?: true

Size: 1019 Bytes

Versions: 7

Compression:

Stored size: 1019 Bytes

Contents

require 'polyblock'
require 'ckeditor'

module Polyblock
  require 'rails'
  class Engine < ::Rails::Engine
    isolate_namespace Polyblock

    require 'polyblock/controller_helpers'
    require 'polyblock/view_helpers'
    require 'polyblock/strong_params_helper'
    require 'polyblock/simple_form_helper'

    initializer 'polyblock_engine.action_controller' do |app|
      ActiveSupport.on_load :action_controller do
        ActionController::Base.send :include, ControllerHelpers
      end
    end

    initializer 'polyblock.view_helpers' do
      ActiveSupport.on_load :action_view do
        ActionView::Base.send :include, ViewHelpers
        if defined? SimpleForm
          ActionView::Base.send :include, SimpleFormHelper
          SimpleForm::FormBuilder.send :define_method, 'simple_fields_for_polyblock' do |*args, &block|
            name, *remaining_args = args
            template.simple_fields_for_polyblock name, self, *remaining_args, &block
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
polyblock-1.2.6 lib/polyblock/engine.rb
polyblock-1.2.5 lib/polyblock/engine.rb
polyblock-1.2.4 lib/polyblock/engine.rb
polyblock-1.2.3 lib/polyblock/engine.rb
polyblock-1.2.2 lib/polyblock/engine.rb
polyblock-1.2.1 lib/polyblock/engine.rb
polyblock-1.2.0 lib/polyblock/engine.rb