Sha256: 15547abaa9a12d48dd533ba2f8cc3f42e07ca2ae334c48e51edfcad221175137

Contents?: true

Size: 600 Bytes

Versions: 8

Compression:

Stored size: 600 Bytes

Contents

require 'bulma_form_builder/form_builder'

module BulmaFormBuilder
  module FormHelper
    def bulma_form_with(options = {}, &block)
      options.reverse_merge!(builder: ::BulmaFormBuilder::FormBuilder)

      _with_bulma_form_field_error_proc do
        form_with(options, &block)
      end
    end

    def _with_bulma_form_field_error_proc
      original_proc = ActionView::Base.field_error_proc
      ActionView::Base.field_error_proc = proc do |html_tag, _instance_tag|
        html_tag
      end
      yield
    ensure
      ActionView::Base.field_error_proc = original_proc
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
bulma_form_builder-0.4.1 lib/bulma_form_builder/form_helper.rb
bulma_form_builder-0.4.0 lib/bulma_form_builder/form_helper.rb
bulma_form_builder-0.3.1 lib/bulma_form_builder/form_helper.rb
bulma_form_builder-0.3.0 lib/bulma_form_builder/form_helper.rb
bulma_form_builder-0.2.1 lib/bulma_form_builder/form_helper.rb
bulma_form_builder-0.2.0 lib/bulma_form_builder/form_helper.rb
bulma_form_builder-0.1.1 lib/bulma_form_builder/form_helper.rb
bulma_form_builder-0.1.0 lib/bulma_form_builder/form_helper.rb