stouset / twitter_bootstrap_form_for

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

select doesn't accept :class or :disabled attributes #13

Closed jcampb closed 13 years ago

jcampb commented 13 years ago

Maybe I'm missing something...but when I pass class or disabled attributes to the select option, they don't get passed through to the form.

<%= f.select(:foo,"Foo",foo_items_for_select,:disabled => true)%>

I checked and the attributes do get passed to text_fields

Any ideas on how to include this?

stouset commented 13 years ago

You need to provide an empty options hash before you can specify options for the html_options hash. The method signature for the select method in Rails is

<%= f.select(method, choices, options = {}, html_options = {}) %>

I enhance it with a label option, so it becomes

<%= f.select(method, label, choices, options = {}, html_options = {}) %>

I'm closing this, since this isn't something that's been altered or broken by my gem (best I can tell). Please let me know if this doesn't fix your issue, so I can reopen and investigate.

jcampb commented 13 years ago

Great thank you! Sorry noob mistake