class SimpleForm::Wrappers::Root
Experimental RBS support (using type sampling data from the type_fusion
project).
# sig/simple_form/wrappers/root.rbs class SimpleForm::Wrappers::Root < SimpleForm::Wrappers::Many def html_class: (Symbol key, Hash options) -> nil def html_classes: ((SimpleForm::Inputs::CollectionSelectInput | SimpleForm::Inputs::StringInput) input, Hash options) -> untyped def render: (SimpleForm::Inputs::StringInput input) -> untyped end
always have a namespace and to add special html classes.
‘Root` is the root wrapper for all components. It is special cased to
def find(name)
def find(name) super || SimpleForm::Wrappers::Many.new(name, [Leaf.new(name)]) end
def html_class(key, options)
Experimental RBS support (using type sampling data from the type_fusion
project).
def html_class: (Symbol key, (maxlength | FalseClass | minlength | FalseClass | pattern | FalseClass | min_max | FalseClass | readonly | FalseClass | maxlength | FalseClass | minlength | FalseClass | pattern | FalseClass | min_max | FalseClass | readonly | FalseClass | label | String | as | Symbol | valid_class | Symbol | maxlength | FalseClass | minlength | FalseClass | pattern | FalseClass | min_max | FalseClass | readonly | FalseClass | placeholder | FalseClass | default | String) options) -> nil
This signature was generated using 3 samples from 2 applications.
def html_class(key, options) css = (options[:"wrapper_#{key}"] || @defaults[key]) css if css && yield end
def html_classes(input, options)
Experimental RBS support (using type sampling data from the type_fusion
project).
def html_classes: ((SimpleForm::Inputs::CollectionSelectInput | SimpleForm::Inputs::StringInput) input, (valid_class | Symbol | maxlength | FalseClass | minlength | FalseClass | pattern | FalseClass | min_max | FalseClass | readonly | FalseClass | placeholder | FalseClass | label | String | prompt | String | input_html | data | controller | String | action | String | as | Symbol | maxlength | FalseClass | minlength | FalseClass | pattern | FalseClass | min_max | FalseClass | readonly | FalseClass) options) -> untyped
This signature was generated using 2 samples from 2 applications.
def html_classes(input, options) css = options[:wrapper_class] ? Array(options[:wrapper_class]) : @defaults[:class] css += SimpleForm.additional_classes_for(:wrapper) do input.additional_classes + [input.input_class] end css << html_class(:error_class, options) { input.has_errors? } css << html_class(:hint_class, options) { input.has_hint? } css << html_class(:valid_class, options) { input.valid? } css.compact end
def initialize(*args)
def initialize(*args) super(:wrapper, *args) @options = @defaults.except(:tag, :class, :error_class, :hint_class) end
def render(input)
Experimental RBS support (using type sampling data from the type_fusion
project).
def render: (SimpleForm::Inputs::StringInput input) -> untyped
This signature was generated using 1 sample from 1 application.
def render(input) input.options.reverse_merge!(@options) super end