Upgrade to rails 4.1
This commit is contained in:
parent
6188567931
commit
6e990fed4c
23 changed files with 179 additions and 197 deletions
|
|
@ -1,13 +1,12 @@
|
|||
# Use this setup block to configure all options available in SimpleForm.
|
||||
require 'simple_form'
|
||||
SimpleForm.setup do |config|
|
||||
# Wrappers are used by the form builder to generate a
|
||||
# complete input. You can remove any component from the
|
||||
# wrapper, change the order or even add your own to the
|
||||
# stack. The options given below are used to wrap the
|
||||
# whole input.
|
||||
config.wrappers :default, :class => :input,
|
||||
:hint_class => :field_with_hint, :error_class => :field_with_errors do |b|
|
||||
config.wrappers :default, class: :input,
|
||||
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
||||
## Extensions enabled by default
|
||||
# Any of these extensions can be disabled for a
|
||||
# given input by passing: `f.input EXTENSION_NAME => false`.
|
||||
|
|
@ -19,7 +18,7 @@ SimpleForm.setup do |config|
|
|||
b.use :html5
|
||||
|
||||
# Calculates placeholders automatically from I18n
|
||||
# You can also pass a string as f.input :placeholder => "Placeholder"
|
||||
# You can also pass a string as f.input placeholder: "Placeholder"
|
||||
b.use :placeholder
|
||||
|
||||
## Optional extensions
|
||||
|
|
@ -42,8 +41,8 @@ SimpleForm.setup do |config|
|
|||
|
||||
## Inputs
|
||||
b.use :label_input
|
||||
b.use :hint, :wrap_with => { :tag => :span, :class => :hint }
|
||||
b.use :error, :wrap_with => { :tag => :span, :class => :error }
|
||||
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
||||
b.use :error, wrap_with: { tag: :span, class: :error }
|
||||
end
|
||||
|
||||
# The default wrapper to be used by the FormBuilder.
|
||||
|
|
@ -51,8 +50,8 @@ SimpleForm.setup do |config|
|
|||
|
||||
# Define the way to render check boxes / radio buttons with labels.
|
||||
# Defaults to :nested for bootstrap config.
|
||||
# :inline => input + label
|
||||
# :nested => label > input
|
||||
# inline: input + label
|
||||
# nested: label > input
|
||||
config.boolean_style = :nested
|
||||
|
||||
# Default class for buttons
|
||||
|
|
@ -107,8 +106,11 @@ SimpleForm.setup do |config|
|
|||
# Whether attributes are required by default (or not). Default is true.
|
||||
# config.required_by_default = true
|
||||
|
||||
# Tell browsers whether to use default HTML5 validations (novalidate option).
|
||||
# Default is enabled.
|
||||
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
||||
# These validations are enabled in SimpleForm's internal config but disabled by default
|
||||
# in this configuration, which is recommended due to some quirks from different browsers.
|
||||
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
||||
# change this configuration to true.
|
||||
config.browser_validations = true
|
||||
|
||||
# Collection of methods to detect if a file type was given.
|
||||
|
|
@ -121,7 +123,7 @@ SimpleForm.setup do |config|
|
|||
|
||||
# Custom wrappers for input types. This should be a hash containing an input
|
||||
# type as key and the wrapper that will be used for all inputs with specified type.
|
||||
# config.wrapper_mappings = { :string => :prepend }
|
||||
# config.wrapper_mappings = { string: :prepend }
|
||||
|
||||
# Default priority for time_zone inputs.
|
||||
# config.time_zone_priority = nil
|
||||
|
|
@ -129,9 +131,6 @@ SimpleForm.setup do |config|
|
|||
# Default priority for country inputs.
|
||||
# config.country_priority = nil
|
||||
|
||||
# Default size for text inputs.
|
||||
# config.default_input_size = 50
|
||||
|
||||
# When false, do not use translations for labels.
|
||||
# config.translate_labels = true
|
||||
|
||||
|
|
@ -140,4 +139,7 @@ SimpleForm.setup do |config|
|
|||
|
||||
# Cache SimpleForm inputs discovery
|
||||
# config.cache_discovery = !Rails.env.development?
|
||||
|
||||
# Default class for inputs
|
||||
# config.input_class = nil
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue