rafaelfranca/simple_form-bootstrap — Issue #2: check boxes and option boxes
Author: tmaier
Created: 2011-10-17 12:21:15+00:00
State: open

Alright, I tried my luck with getting check boxes and option boxes support.

If you present the html necessary as haml then it would look like this:

```haml
.clearfix
%label
.input
%ul.inputs-list
%li
%label
%input
%li
%label
%input
```

So the wrapper configuration would need to look like something like this:

```ruby
config.wrappers :inline, :class => 'clearfix', :error_class => :error do |b|
b.use :placeholder
b.use :label # how to get the label of all options boxes?
b.use :tag => 'div', :class => 'input' do |ba|
# how to use conditionally this (if many field)...
ba.use :tag => 'ul', :class => '.inputs-list' do |bc|
bb.use :tag => 'li' do |input|
bc.use :label do |input|
input.use :input
end
end
end
ba.use :input # ...or this if this is single field?
ba.use :error, :tag => :span, :class => :'help-inline'
ba.use :hint, :tag => :span, :class => :'help-block'
end
end
```

My questions:

1. How to tell `b.use :label` to show the label of the option group?
2. How to conditionally use the rather complex part from above when there are option boxes or check boxes and the rather simple `ba.use :input` when it is a single text field?

I would really appreciate some hints and tips.