plataformatec/simple_form — pull request #622 by stephenprater (2012-07-16 17:20:09+00:00)
Title: add html classes to inputs with the wrappers API

enable a user to add classes or other html attributes to inputs,
labels, and custome components using the wrappers API. this is
accomplished by passing `false` to the tag key of the wrap_with
options - like so

b.use :input, :wrap_with { :tag => false, :class => ['cool'] }

passing an argument with a `false` tag is only meaningful in the case
of a single wrapped component which generates a tag itself
(so, `label` and `input` is about it out of the box.) A custom
component which wants to support this functionality should look in
`options[:#{namespace}_html]` for the html options to use.

My particular use case for this is that I have about a dozen different
forms, but only three "looks" - and bootstrap has a few places where
you need to put classes on the input. Rather than have to use
a custom input type, just to add a class to the string input, i want
to create three different wrappers for my three different looks and
specify the wrapper once.