Skip to content
Browse files

Update initializer

  • Loading branch information...
1 parent c1f6ad6 commit 2b10e3950a309b54f4f5e6c85caadc106176d83d @carlosantoniodasilva carlosantoniodasilva committed
Showing with 15 additions and 31 deletions.
  1. +15 −31 config/initializers/simple_form.rb
View
46 config/initializers/simple_form.rb
@@ -45,13 +45,6 @@
b.use :error, :tag => :span, :class => :error
end
-
- # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
- # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
- # to learn about the different styles for forms and inputs,
- # buttons and other elements.
- config.default_wrapper = :bootstrap
-
config.wrappers :bootstrap, :tag => 'fieldset', :class => 'control-group', :error_class => 'error' do |b|
b.use :placeholder
b.use :label, :class => 'control-label'
@@ -62,26 +55,6 @@
end
end
- config.wrappers :checkbox, :tag => 'fieldset', :class => 'control-group', :error_class => 'error' do |b|
- b.use :placeholder
- b.use :label, :class => 'control-label'
- b.use :tag => 'div', :class => 'controls' do |ba|
- ba.use :tag => 'label', :class => 'checkbox' do |bb|
- bb.use :input
- end
- ba.use :error, :tag => 'span', :class => 'help-inline'
- ba.use :hint, :tag => 'p', :class => 'help-block'
- end
- end
-
- config.wrappers :inline_checkbox, :tag => 'span', :error_class => 'error' do |b|
- b.use :placeholder
- b.use :input
- b.use :label_text
- b.use :error, :tag => 'span', :class => 'help-inline'
- b.use :hint, :tag => 'p', :class => 'help-block'
- end
-
config.wrappers :prepend, :tag => 'fieldset', :class => "control-group", :error_class => 'error' do |b|
b.use :placeholder
b.use :label, :class => 'control-label'
@@ -105,7 +78,21 @@
input.use :error, :tag => 'span', :class => 'help-inline'
end
end
-
+
+ # Wrappers for forms and inputs using the Twitter Bootstrap toolkit.
+ # Check the Bootstrap docs (http://twitter.github.com/bootstrap)
+ # to learn about the different styles for forms and inputs,
+ # buttons and other elements.
+ config.default_wrapper = :bootstrap
+
+ # Define the way to render check boxes / radio buttons with labels.
+ # Defaults to :nested for bootstrap config.
+ # :inline => input + label
+ # :nested => label > input
+ config.boolean_style = :nested
+
+ # Default class for buttons
+ config.button_class = 'btn'
# Method used to tidy up errors.
# config.error_method = :first
@@ -175,7 +162,4 @@
# Cache simple form inputs discovery
# config.cache_discovery = !Rails.env.development?
-
- # Default class for buttons
- # config.button_class = 'button'
end

0 comments on commit 2b10e39

Please sign in to comment.
Something went wrong with that request. Please try again.