stouset / twitter_bootstrap_form_for

A Rails FormBuilder DSL for generating Twitter Bootstrap forms
https://github.com/stouset/twitter_bootstrap_form_for
MIT License
409 stars 110 forks source link

Allow configuration of label html #65

Open thechrisoshow opened 12 years ago

thechrisoshow commented 12 years ago

I want to be able to add a class to the label sometimes, and I can't figure out a way to do it.

In order to do this in my own project I've added an option 'label_html'. This is just like the simple_form option in that it allows you to set ids/classes on the label.

e.g.

  = f.text_field :address_line1, 'Address line 1', label_html: { class: "required" }

Let's you put a 'required' class on the label

Pull request: https://github.com/stouset/twitter_bootstrap_form_for/pull/66