summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-16 11:10:02 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-02-16 11:10:02 +0100
commit5d8ce5f4775ac8bc5f523964e6e36f63ff3c4683 (patch)
tree49ed889b1d10cda98c475f3453abff1b97afb4e7 /config/initializers
parentc9066760fd1f5f2f892ce2be5cf2a83bb5210246 (diff)
parent55784bcffc0678ce6102c0b81447434a8030ebd2 (diff)
Merge branch 'develop'5.1-beta5
Diffstat (limited to 'config/initializers')
-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