Sha256: cc1a395d193768181203370ea8cf2e95ed790c56a2a9ba99b7019ec1d0c0f642

Contents?: true

Size: 802 Bytes

Versions: 4

Compression:

Stored size: 802 Bytes

Contents

module StrongForm
  class Railtie < Rails::Railtie
    initializer 'strong_form.injects' do
      ActiveSupport.on_load(:active_record) do
        ActiveRecord::Base.include StrongForm::Record
      end

      ActiveSupport.on_load(:action_view) do
        %w(
          CheckBox
          CollectionSelect
          DateSelect
          RadioButton
          Select
          TextArea
          TextField
          TimeZoneSelect
        ).each do |klass|
          "ActionView::Helpers::Tags::#{klass}"
            .constantize.include StrongForm::Tag
        end

        if defined?(::NestedForm)
          require('strong_form/nested_form')
          require('nested_form/builder_mixin')
          ::NestedForm::BuilderMixin.include StrongForm::NestedForm
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
strong_form-0.0.8 lib/strong_form/railtie.rb
strong_form-0.0.6 lib/strong_form/railtie.rb
strong_form-0.0.5 lib/strong_form/railtie.rb
strong_form-0.0.4 lib/strong_form/railtie.rb