diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-18 16:37:15 +0200 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-10-18 16:37:15 +0200 |
commit | 43df35213e80b9b7de69cc80f138882708a05b9b (patch) | |
tree | d3b70597b5172f0daf2b95e6cd4a48a7bc6d7b56 /config | |
parent | 6f7c9774c776afeea0d98cbbd30483f4f0c6b938 (diff) |
Improving all forms
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/simple_form.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 934487af6..e0c22e0c2 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -40,7 +40,7 @@ SimpleForm.setup do |config| b.optional :readonly ## Inputs - b.use :label_input + b.use :input b.use :hint, wrap_with: { tag: :span, class: :hint } b.use :error, wrap_with: { tag: :span, class: :error } @@ -51,6 +51,14 @@ SimpleForm.setup do |config| # b.use :full_error, wrap_with: { tag: :span, class: :error } end + config.wrappers :with_label, class: :input, + hint_class: :field_with_hint, error_class: :field_with_errors do |b| + b.use :html5 + b.use :hint, wrap_with: { tag: :span, class: :hint } + b.use :error, wrap_with: { tag: :span, class: :error } + b.use :label_input + end + # The default wrapper to be used by the FormBuilder. config.default_wrapper = :default |