Sha256: 2bdf0e0f32ee4d5a5361461610f9fdbc60a7402665935cbbb14f31651879c187

Contents?: true

Size: 670 Bytes

Versions: 2

Compression:

Stored size: 670 Bytes

Contents

module HungryForm
  module Rails
    class Railtie < ::Rails::Railtie

      module Configuration
        attr_accessor :rails
      end

      initializer 'hungryform', before: :load_config_initializers do
        HungryForm::Elements::Base::Element.send :include, Renderable

        HungryForm.configuration.extend Configuration
        HungryForm.configuration.rails = ActiveSupport::OrderedOptions.new
        HungryForm.configuration.rails.elements_templates = 'hungryform'
      end

      initializer 'active_support' do
        ActiveSupport.on_load(:action_view) do
          ::ActionView::Base.send :include, ActionView
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hungryform-rails-0.0.4 lib/hungryform/rails/railtie.rb
hungryform-rails-0.0.3 lib/hungryform/rails/railtie.rb