`Root` is the root wrapper for all components. It is special cased to always have a namespace and to add special html classes.
# File lib/simple_form/wrappers/root.rb, line 8 def initialize(*args) super(:wrapper, *args) @options = @defaults.except(:tag, :class, :error_class, :hint_class) end
Provide a fallback if name cannot be found.
# File lib/simple_form/wrappers/root.rb, line 19 def find(name) super || SimpleForm::Wrappers::Many.new(name, [name]) end
# File lib/simple_form/wrappers/root.rb, line 13 def render(input) input.options.reverse_merge!(@options) super end
# File lib/simple_form/wrappers/root.rb, line 25 def html_classes(input, options) css = options[:wrapper_class] ? Array.wrap(options[:wrapper_class]) : @defaults[:class] css += SimpleForm.additional_classes_for(:wrapper) { input.additional_classes } css << (options[:wrapper_error_class] || @defaults[:error_class]) if input.has_errors? css << (options[:wrapper_hint_class] || @defaults[:hint_class]) if input.has_hint? css.compact end