# frozen_string_literal: true## Uncomment this and change the path if necessary to include your own# components.# See https://github.com/heartcombo/simple_form#custom-components to know# more about custom components.# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }## Use this setup block to configure all options available in SimpleForm.SimpleForm.setupdo|config|# Don't forget to edit this file to adapt it to your needs (specially# all the grid-related classes)## Please note that hints are commented out by default since Foundation# doesn't provide styles for hints. You will need to provide your own CSS styles for hints.# Uncomment them to enable hints.config.wrappers:vertical_form,class: :input,hint_class: :field_with_hint,error_class: :error,valid_class: :validdo|b|b.use:html5b.use:placeholderb.optional:maxlengthb.optional:minlengthb.optional:patternb.optional:min_maxb.optional:readonlyb.use:label_inputb.use:error,wrap_with: {tag: :small,class: :error}# b.use :hint, wrap_with: { tag: :span, class: :hint }endconfig.wrappers:horizontal_form,tag: 'div',class: 'row',hint_class: :field_with_hint,error_class: :error,valid_class: :validdo|b|b.use:html5b.use:placeholderb.optional:maxlengthb.optional:minlengthb.optional:patternb.optional:min_maxb.optional:readonlyb.wrapper:label_wrapper,tag: :div,class: 'small-3 columns'do|ba|ba.use:label,class: 'text-right inline'endb.wrapper:right_input_wrapper,tag: :div,class: 'small-9 columns'do|ba|ba.use:inputba.use:error,wrap_with: {tag: :small,class: :error}# ba.use :hint, wrap_with: { tag: :span, class: :hint }endendconfig.wrappers:horizontal_radio_and_checkboxes,tag: 'div',class: 'row'do|b|b.use:html5b.optional:readonlyb.wrapper:container_wrapper,tag: 'div',class: 'small-offset-3 small-9 columns'do|ba|ba.wrappertag: 'label',class: 'checkbox'do|bb|bb.use:inputbb.use:label_textendba.use:error,wrap_with: {tag: :small,class: :error}# ba.use :hint, wrap_with: { tag: :span, class: :hint }endend# Foundation does not provide a way to handle inline forms# This wrapper can be used to create an inline form# by hiding that labels on every screen sizes ('hidden-for-small-up').## Note that you need to adapt this wrapper to your needs. If you need a 4# columns form then change the wrapper class to 'small-3', if you need# only two use 'small-6' and so on.config.wrappers:inline_form,tag: 'div',class: 'column small-4',hint_class: :field_with_hint,error_class: :error,valid_class: :validdo|b|b.use:html5b.use:placeholderb.optional:maxlengthb.optional:minlengthb.optional:patternb.optional:min_maxb.optional:readonlyb.use:label,class: 'hidden-for-small-up'b.use:inputb.use:error,wrap_with: {tag: :small,class: :error}# b.use :hint, wrap_with: { tag: :span, class: :hint }end# Examples of use:# - wrapper_html: {class: 'row'}, custom_wrapper_html: {class: 'column small-12'}# - custom_wrapper_html: {class: 'column small-3 end'}config.wrappers:customizable_wrapper,tag: 'div',error_class: :error,valid_class: :validdo|b|b.use:html5b.optional:readonlyb.wrapper:custom_wrapper,tag: :divdo|ba|ba.use:label_inputendb.use:error,wrap_with: {tag: :small,class: :error}# b.use :hint, wrap_with: { tag: :span, class: :hint }end# CSS class for buttonsconfig.button_class='button'# Set this to div to make the checkbox and radio properly work# otherwise simple_form adds a label tag instead of a div around# the nested labelconfig.item_wrapper_tag=:div# CSS class to add for error notification helper.config.error_notification_class='alert-box alert'# The default wrapper to be used by the FormBuilder.config.default_wrapper=:vertical_form# Defines validation classes to the input_field. By default it's nil.# config.input_field_valid_class = 'is-valid'# config.input_field_error_class = 'is-invalid'end