simple_form.rb revision 25f979bdee494bf6a6aeb54d753352832212dd24
770N/A# Use this setup block to configure all options available in SimpleForm. 770N/A # Wrappers are used by the form builder to generate a 97N/A # complete input. You can remove any component from the 770N/A # wrapper, change the order or even add your own to the 97N/A # stack. The options given below are used to wrap the 97N/A ## Extensions enabled by default 97N/A # Any of these extensions can be disabled for a 97N/A # given input by passing: `f.input EXTENSION_NAME => false`. 97N/A # You can make any of these extensions optional by 97N/A # Determines whether to use HTML5 (:email, :url, ...) 97N/A # and required attributes 97N/A # Calculates placeholders automatically from I18n 97N/A # You can also pass a string as f.input :placeholder => "Placeholder" 97N/A ## Optional extensions 97N/A # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup` 97N/A # to the input. If so, they will retrieve the values from the model 97N/A # if any exists. If you want to enable the lookup for any of those # Calculates maxlength from length validations for string inputs # Calculates pattern from format validations for string inputs # Calculates min and max from length validations for numeric inputs # Calculates readonly automatically from readonly attributes # The default wrapper to be used by the FormBuilder. # Define the way to render check boxes / radio buttons with labels. # Defaults to :nested for bootstrap config. # :inline => input + label # :nested => label > input # Default class for buttons # Method used to tidy up errors. Specify any Rails Array method. # :first lists the first message for each field. # Use :to_sentence to list all errors for each field. # Default tag used for error notification helper. # CSS class to add for error notification helper. # ID to add for error notification helper. # Series of attempts to detect a default label method for collection. # Series of attempts to detect a default value method for collection. # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. # You can define the class to use on all collection wrappers. Defaulting to none. # You can wrap each item in a collection of radio/check boxes with a tag, # defaulting to :span. Please note that when using :boolean_style = :nested, # SimpleForm will force this option to be a label. # You can define a class to use in all item wrappers. Defaulting to none. # How the label text should be generated altogether with the required text. # config.label_text = lambda { |label, required| "#{required} #{label}" } # You can define the class to use on all labels. Default is nil. # You can define the class to use on all forms. Default is simple_form. # You can define which elements should obtain additional classes # Whether attributes are required by default (or not). Default is true. # Tell browsers whether to use default HTML5 validations (novalidate option). # Collection of methods to detect if a file type was given. # config.file_methods = [ :mounted_as, :file?, :public_filename ] # Custom mappings for input types. This should be a hash containing a regexp # to match as key, and the input type that will be used when the field name # matches the regexp as value. # 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. # Default priority for time_zone inputs. # Default priority for country inputs. # Default size for text inputs. # When false, do not use translations for labels. # Automatically discover new inputs in Rails' autoload path. # Cache SimpleForm inputs discovery require 'simple_form_extensions'