Sha256: a649374d1364f0ccd0d2b6a78f1fc5d1e7c284650eb313ff64b399dad8556197

Contents?: true

Size: 1.11 KB

Versions: 15

Compression:

Stored size: 1.11 KB

Contents

module Binco
  module FormHelper
    def bootstrap_form_for(record, options = {}, &block)
      options[:builder] = BootstrapFormBuilder
      form_for(record, options, &block)
    end

    def bootstrap_form_with(model: nil, scope: nil, url: nil, format: nil, **options, &block)
      options[:builder] = BootstrapFormBuilder

      if block_given?
        form_with(model: model, scope: scope, url: url, format: format, **options, &block)
      else
        form_with(model: model, scope: scope, url: url, format: format, **options)
      end
    end

    def bootstrap_form_tag(url_for_options = {}, options = {}, &block)
      options[:acts_like_form_tag] = true
      options[:url] = url_for_options
      bootstrap_form_for("", options, &block)
    end

    def materialize_form_for(record, options = {}, &block)
      options[:builder] = MaterializeFormBuilder
      form_for(record, options, &block)
    end

    def materialize_form_tag(url_for_options = {}, options = {}, &block)
      options[:acts_like_form_tag] = true
      options[:url] = url_for_options
      materialize_form_for("", options, &block)
    end

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
binco-4.0.0 app/helpers/binco/form_helper.rb
binco-3.5.4 app/helpers/binco/form_helper.rb
binco-3.5.2 app/helpers/binco/form_helper.rb
binco-3.5.1 app/helpers/binco/form_helper.rb
binco-3.5.0 app/helpers/binco/form_helper.rb
binco-3.4.0 app/helpers/binco/form_helper.rb
binco-3.3.0 app/helpers/binco/form_helper.rb
binco-3.2.1 app/helpers/binco/form_helper.rb
binco-3.2.0 app/helpers/binco/form_helper.rb
binco-3.1.6 app/helpers/binco/form_helper.rb
binco-3.1.5 app/helpers/binco/form_helper.rb
binco-3.1.4 app/helpers/binco/form_helper.rb
binco-3.1.3 app/helpers/binco/form_helper.rb
binco-3.1.2 app/helpers/binco/form_helper.rb
binco-3.1.1 app/helpers/binco/form_helper.rb