summaryrefslogtreecommitdiff
path: root/config/initializers/simple_form.rb
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers/simple_form.rb')
-rw-r--r--config/initializers/simple_form.rb20
1 files changed, 17 insertions, 3 deletions
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb
index 572d58f..062f823 100644
--- a/config/initializers/simple_form.rb
+++ b/config/initializers/simple_form.rb
@@ -82,6 +82,20 @@ SimpleForm.setup do |config|
end
end
+ config.wrappers :checkbox, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b|
+ b.use :html5
+ b.use :placeholder
+ b.wrapper :tag => 'div', :class => 'controls' do |input|
+ input.wrapper :tag => 'div', :class => 'simple-checkbox' do |prepend|
+ prepend.use :label_input
+ end
+ input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' }
+ input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
+ end
+ end
+
+ config.wrapper_mappings = { :boolean => :checkbox }
+
# 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,
@@ -95,7 +109,7 @@ SimpleForm.setup do |config|
config.boolean_style = :nested
# Default class for buttons
- config.button_class = 'btn btn-primary'
+ config.button_class = 'btn'
# Method used to tidy up errors.
# config.error_method = :first
@@ -136,7 +150,7 @@ SimpleForm.setup do |config|
config.label_class = 'control-label'
# You can define the class to use on all forms. Default is simple_form.
- # config.form_class = :simple_form
+ config.form_class = 'simple_form form-horizontal'
# You can define which elements should obtain additional classes
# config.generate_additional_classes_for = [:wrapper, :label, :input]
@@ -163,7 +177,7 @@ SimpleForm.setup do |config|
# config.country_priority = nil
# Default size for text inputs.
- # config.default_input_size = 50
+ config.default_input_size = 150
# When false, do not use translations for labels.
# config.translate_labels = true