I'm trying to build a rails app and simple_form looks to be a really useful gem. Problem is that I am using twitter bootstrap css to do the styling and the simple_form doesn't allow you to specify the layout of the html.
Can anyone tell me how I can conform the simple_form html into the format bootstrap css wants?
Note: This answer only applies to SimpleForm < 2.0
Start with this in config/initializers/simple_form.rb
:
SimpleForm.form_class = nil SimpleForm.wrapper_class = 'clearfix' SimpleForm.wrapper_error_class = 'error' SimpleForm.error_class = 'help-inline'
Then there's space missing between the label element and the input, which you can add with this:
label { margin-right: 20px; }
There's probably more, but it's a start.
Simple form 2.0 is bootstrap-aware:
rails generate simple_form:install --bootstrap
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With