Sha256: 42c7c3d0c13cff99fd23da0e6ce4ee78a7f7eb8cb79411a67759693189a8e9bd

Contents?: true

Size: 1.23 KB

Versions: 20

Compression:

Stored size: 1.23 KB

Contents

SimpleForm.setup do |config|
  config.wrappers :default, tag: :div, class: 'form-group', error_class: 'has-error' do |b|
    b.use :html5
    b.use :min_max
    b.use :maxlength
    b.use :placeholder

    b.optional :pattern
    b.optional :readonly

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

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

    b.wrapper tag: :div, class: 'checkbox' do |c|
      c.wrapper tag: :label do |a|
        a.use :input
        a.use :label_text
      end
    end
    b.use :error, wrap_with: { tag: :span, class: "help-block" }
    b.use :hint,  wrap_with: { tag: :p, class: "help-block" }
  end

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

    b.wrapper tag: :div, class: 'radio' do |c|
      c.wrapper tag: :label do |a|
        a.use :input
        a.use :label_text
      end
    end
    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

20 entries across 20 versions & 1 rubygems

Version Path
simple_form_bootstrap3-0.3.6 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.3.5 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.3.4 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.3.3 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.3.2 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.3.1 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.3.0 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.9 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.8 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.7 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.6 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.5 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.4 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.3 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.2 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.1 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.2.0 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.1.1 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.1.0 config/initializers/simple_form_default.rb
simple_form_bootstrap3-0.0.1 config/initializers/simple_form_default.rb