diff options
author | spag <spag@golwen.net> | 2013-02-14 10:42:39 +0100 |
---|---|---|
committer | spag <spag@golwen.net> | 2013-02-14 10:42:39 +0100 |
commit | 41303b0a2a07b897f7373eebba25708da89085a1 (patch) | |
tree | 88e48da31bdd92d80af76c18d0df992f7d09f91b /config | |
parent | a1aafe9eec98f91fd76d104964ad98fcafc94a80 (diff) | |
parent | a9bf3a7e1fd802025824668e477a5ec14ce81d5a (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/simple_form.rb | 20 |
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 |