econsultancy/simple_form — pull request #2 by IanVaughan (2014-05-28 11:00:38+00:00)
Title: V2 1 no empty wrapper divs

This removes the rendered HTML for wrappers when the block yeilds no content.

e.g. when defining an optional component :
```ruby
ba.wrapper tag: :div, class: 'form-helper -message -hint' do |bb|
bb.optional :hint, wrap_with: { tag: :p }
end
```
and that component is not used in a template :
```erb
<%= form.input :name %>
```
Then the HTML output still contains the wrapper output, in this case an empty `div` tag :
```html

```
With this change, the above template would not output the above HTML.

If this behaviour is not desired, then the output of the empty tags can
be enabled via the `output_empty` option.
```ruby
ba.wrapper tag: :div, class: 'form-helper -message -hint', output_empty: true do |bb|
bb.optional :hint, wrap_with: { tag: :p }
end
```