Sha256: 660b50b41b001306062a776390c569ae3e64df8c4432d529f0034b785bbf58b1

Contents?: true

Size: 1.98 KB

Versions: 29

Compression:

Stored size: 1.98 KB

Contents

SimpleForm.setup do |config|
  # horizontal form
  config.wrappers :horizontal_filter_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
    b.use :html5
    b.use :placeholder
    b.optional :maxlength
    b.optional :pattern
    b.optional :min_max
    b.optional :readonly
    b.use :label, class: 'col-sm-2 col-md-1 control-label'

    b.wrapper tag: 'div', class: 'col-sm-6 col-md-6' do |ba|
      ba.use :input, class: 'form-control'
      ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
      ba.use :hint,  wrap_with: { tag: 'p', class: 'help-block' }
    end
  end

  config.wrappers :horizontal_filter_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
    b.use :html5
    b.optional :readonly

    b.wrapper tag: 'div', class: 'col-md-offset-1 col-md-6' do |wr|
      wr.wrapper tag: 'div', class: 'checkbox' do |ba|
        ba.use :label_input, class: 'col-md-1'
      end

      wr.use :error, wrap_with: { tag: 'span', class: 'help-block' }
      wr.use :hint,  wrap_with: { tag: 'p', class: 'help-block' }
    end
  end

  config.wrappers :horizontal_filter_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
    b.use :html5
    b.optional :readonly

    b.use :label, class: 'col-sm-1 col-md-1 control-label'

    b.wrapper tag: 'div', class: 'col-sm-6 col-md-6' do |ba|
      ba.use :input
      ba.use :error, wrap_with: { tag: 'span', class: 'help-block' }
      ba.use :hint,  wrap_with: { tag: 'p', class: 'help-block' }
    end
  end



  # inline form

  config.wrappers :inline_filter_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
    b.use :html5
    b.use :placeholder
    b.optional :maxlength
    b.optional :pattern
    b.optional :min_max
    b.optional :readonly
    b.use :label, class: 'sr-only'

    b.use :input, class: 'form-control'
    b.use :error, wrap_with: { tag: 'span', class: 'help-block' }
    b.use :hint,  wrap_with: { tag: 'p', class: 'help-block' }
  end


end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
simple_search_filter-0.2.1 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.1.1 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.1.0 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.31 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.30 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.29 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.28 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.27 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.26 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.25 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.24 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.23 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.22 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.21 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.20 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.17 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.16 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.15 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.13 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb
simple_search_filter-0.0.12 lib/simple_search_filter/simple_form_extensions/wrappers_bootstrap.rb