class Formalist::Elements::RichTextArea

Public Instance Methods

attributes() click to toggle source

FIXME: it would be tidier to have a reader method for each attribute

Calls superclass method
# File lib/formalist/elements/standard/rich_text_area.rb, line 14
def attributes
  super.merge(embeddable_forms: embeddable_forms_config)
end
input() click to toggle source
# File lib/formalist/elements/standard/rich_text_area.rb, line 18
def input
  input_compiler.(@input)
end

Private Instance Methods

embeddable_forms_config() click to toggle source

Replace the form objects with their AST

# File lib/formalist/elements/standard/rich_text_area.rb, line 25
def embeddable_forms_config
  @attributes[:embeddable_forms].to_h.map { |key, attrs|
    [key, attrs.merge(form: attrs[:form].to_ast)]
  }.to_h
end
input_compiler() click to toggle source

TODO: make compiler configurable somehow?

# File lib/formalist/elements/standard/rich_text_area.rb, line 32
def input_compiler
  RichText::EmbeddedFormCompiler.new(@attributes[:embeddable_forms])
end