class Formalist::Elements::FormField

Public Instance Methods

fill(input: {}, errors: {}) click to toggle source
Calls superclass method Formalist::ChildForms::ChildForm#fill
# File lib/formalist/elements/form_field.rb, line 8
def fill(input: {}, errors: {})
  input = input[name]
  errors = errors[name].to_a

  super(input: input, errors: errors)
end
to_ast() click to toggle source
# File lib/formalist/elements/form_field.rb, line 15
def to_ast
  [:form_field, [
    name,
    type,
    input,
    Element::Attributes.new(attributes).to_ast,
  ]]
end