HTTPS clone URL
Subversion checkout URL
Twitter Bootstrap integration
- Adding custom components
- Adding custom input components
- Attributes filter
- Bootstrap component helpers
- check_boxes input preselection
- Contact Form using Mail_Form
- Create a fake input that does NOT read attributes
- Create an "input" just for displaying attribute value
- Create an "input" just for displaying custom content (e.g. a link)
- Creating a minimalist form (no labels just placeholders)
- CSS for simple_form
- Custom inputs examples
- Custom Wrappers
- Errors not connected with visible fields
- Foundation 5 & simple_form 3 check boxes
- How to use Bootstrap 3 input group in Simple Form
- HTML5 Attributes
- Nested inputs for key value hash attributes.
- Nested Models
- Simple Form with Devise
- Twitter Bootstrap integration
- Twitter Bootstrap v2 and simple_form v2
- Upgrading to Simple Form 2.0
- Use with ActiveModel compliant models
- Zurb's Foundation integration
Clone this wiki locally
We are working on the Twitter Bootstrap integration on the master branch. You can see an example application here: https://github.com/rafaelfranca/simple_form-bootstrap
We would be very happy if you could use Simpleform master and open up issues for whatever you find!
If you want to try another solution in the section below has a tutorial about integration with SimpleForm 1.5 made by our contributors.
Instructions for (probably half-baked) Twitter Bootstrap integration (SimpleForm 1.5):
lib/simple_form/contained_input_component.rb with the following code:
module SimpleForm module Components module ContainedInput def contained_input '<div class="controls">' + input + (error.nil? ? '' : error) + '</div>' end end end module Inputs class Base include SimpleForm::Components::ContainedInput end end end
config/initializers/simple_form.rb, modify options like this (via http://stackoverflow.com/questions/7198109/rails-using-simple-form-and-integrating-twitter-bootstrap#answer-7300806):
config.components = [ :label, :contained_input ] SimpleForm.wrapper_class = 'control-group' SimpleForm.wrapper_error_class = 'error' SimpleForm.label_class = 'control-label' SimpleForm.error_class = 'help-inline' SimpleForm.form_class = 'form-horizontal'
3) Add the following to the end of
config/initializers/simple_form.rb (before the last
This page was created by the OSS community and might be outdated or incomplete. Feel free to improve or update this content according to the latest versions of SimpleForm and Rails to help the next developer who visits this wiki after you.
Keep in mind to maintain the guides as simple as possible and to avoid additional dependencies that might be specific to your application or workflow (such as Haml, RSpec, Guard and similars).