Update formtastic to version 4.0.0

This commit is contained in:
depfu[bot] 2021-08-11 13:03:38 +00:00 committed by Henne Vogelsang
parent 2527af1c1b
commit 91967e9d70
No known key found for this signature in database
GPG key ID: 97DDB66BDAF8D4D6
4 changed files with 33 additions and 27 deletions

View file

@ -15,17 +15,17 @@
# Should select fields have a blank option/prompt by default?
# Defaults to true.
Formtastic::FormBuilder.include_blank_for_select_by_default = false
# Formtastic::FormBuilder.include_blank_for_select_by_default = true
# Set the string that will be appended to the labels/fieldsets which are required
# Set the string that will be appended to the labels/fieldsets which are required.
# It accepts string or procs and the default is a localized version of
# '<abbr title="required">*</abbr>'. In other words, if you configure formtastic.required
# in your locale, it will replace the abbr title properly. But if you don't want to use
# abbr tag, you can simply give a string as below
Formtastic::FormBuilder.required_string = proc { Formtastic::Util.html_safe(%{&nbsp;<span class="text-warning"><abbr title="This field is required">*</abbr></span>}) }
# abbr tag, you can simply give a string as below.
# Formtastic::FormBuilder.required_string = "(required)"
# Set the string that will be appended to the labels/fieldsets which are optional
# Defaults to an empty string ("") and also accepts procs (see required_string above)
# Set the string that will be appended to the labels/fieldsets which are optional.
# Defaults to an empty string ("") and also accepts procs (see required_string above).
# Formtastic::FormBuilder.optional_string = "(optional)"
# Set the way inline errors will be displayed.
@ -33,7 +33,7 @@ Formtastic::FormBuilder.required_string = proc { Formtastic::Util.html_safe(%{&n
# Formtastic::FormBuilder.inline_errors = :sentence
# Formtastic uses the following classes as default for hints, inline_errors and error list
# If you override the class here, please ensure to override it in your stylesheets as well
# If you override the class here, please ensure to override it in your stylesheets as well.
# Formtastic::FormBuilder.default_hint_class = "inline-hints"
# Formtastic::FormBuilder.default_inline_error_class = "inline-errors"
# Formtastic::FormBuilder.default_error_list_class = "errors"
@ -70,7 +70,7 @@ Formtastic::FormBuilder.required_string = proc { Formtastic::Util.html_safe(%{&n
# can change it to any class you want.
# Formtastic::Helpers::FormHelper.default_form_class = 'formtastic'
# Formtastic will infer a class name from the model, array, string ot symbol you pass to the
# Formtastic will infer a class name from the model, array, string or symbol you pass to the
# form builder. You can customize the way that class is presented by overriding
# this proc.
# Formtastic::Helpers::FormHelper.default_form_model_class_proc = proc { |model_class_name| model_class_name }
@ -85,18 +85,14 @@ Formtastic::FormBuilder.required_string = proc { Formtastic::Util.html_safe(%{&n
# Formtastic::FormBuilder.use_required_attribute = false
# You can opt-in to new HTML5 browser validations (for things like email and url inputs) by setting
# this to true. Doing so will add a `novalidate` attribute to the `<form>` tag.
# this to true. Doing so will omit the `novalidate` attribute from the `<form>` tag.
# See http://diveintohtml5.org/forms.html#validation for more info.
Formtastic::FormBuilder.perform_browser_validations = true
#
Formtastic::Helpers::FormHelper.builder = FormtasticBootstrap::FormBuilder
FormtasticBootstrap::FormBuilder.default_inline_hint_class = FormtasticBootstrap::FormBuilder.default_block_hint_class
# Formtastic::FormBuilder.perform_browser_validations = true
# By creating custom input class finder, you can change how input classes are looked up.
# For example you can make it to search for TextInputFilter instead of TextInput.
# See # TODO: add link # for more information
# NOTE: this behavior will be default from Formtastic 4.0
Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder
# See https://github.com/formtastic/formtastic/wiki/Custom-Class-Finders
# Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder
# Define custom namespaces in which to look up your Input classes. Default is
# to look up in the global scope and in Formtastic::Inputs.
@ -104,10 +100,12 @@ Formtastic::FormBuilder.input_class_finder = Formtastic::InputClassFinder
# By creating custom action class finder, you can change how action classes are looked up.
# For example you can make it to search for MyButtonAction instead of ButtonAction.
# See # TODO: add link # for more information
# NOTE: this behavior will be default from Formtastic 4.0
Formtastic::FormBuilder.action_class_finder = Formtastic::ActionClassFinder
# See https://github.com/formtastic/formtastic/wiki/Custom-Class-Finders
# Formtastic::FormBuilder.action_class_finder = Formtastic::ActionClassFinder
# Define custom namespaces in which to look up your Action classes. Default is
# to look up in the global scope and in Formtastic::Actions.
# Formtastic::FormBuilder.action_namespaces = [ ::Object, ::MyActionsModule, ::Formtastic::Actions ]
# Which columns to skip when automatically rendering a form without any fields specified.
# Formtastic::FormBuilder.skipped_columns = [:created_at, :updated_at, :created_on, :updated_on, :lock_version, :version]