plataformatec/simple_form — Issue #381: Classes added via :input_html option are added to container (Master)
Author: easychris
Created: 2011-12-05 17:00:41+00:00
State: open

After upgrading to latest master I saw a change in behavior for classes that are added via :input_html option. The class gets added to the input field (which is correct) but also added to surrounding container.

I'm using this config file for Twitter Bootstrap:
https://github.com/rafaelfranca/simple_form-bootstrap/blob/master/config/initializers/simple_form.rb

Example (HAML)
```
= simple_form_for @company_profile, wrapper: :inline, url: company_profile_path
= f.input :zipcode, label: t('common.zipcode'), input_html: {class: 'span2', 'data-xxx' => true}
```
Resulting HTML is:
```

Zip Code

```

As you can see, the "span2" class set via :input_html option is added to the surrounding div (clearfix string optional span2). Other attributes (e.g. 'data-xxx' => true) are only added to the input field.

Is that sufficient or should I write a test?