Created
July 28, 2013 04:37
-
-
Save sgringwe/6097423 to your computer and use it in GitHub Desktop.
Using simple_form with twitter bootstrap 3.0. These are the changes I made when upgrading.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleForm.setup do |config| | |
config.wrappers :bootstrap, :tag => 'div', :class => 'form-group', :error_class => 'error' do |b| | |
b.use :html5 | |
b.use :placeholder | |
b.use :label | |
b.wrapper :tag => 'div', :class=> 'col-lg-10' do |ba| | |
ba.use :input # , :class => ['form-control'] | |
ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' } | |
ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' } | |
end | |
end | |
config.default_wrapper = :bootstrap | |
config.label_class = 'control-label col-lg-2' | |
end | |
# In each simple_form_for call | |
defaults: { input_html: { class: "form-control" } } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment