Module: CustomFormGenerator::Helpers::FieldRenderers

Included in:
Generator
Defined in:
lib/custom_form_generator/helpers/field_renderers.rb

Overview

FieldRenderers module handles HTML form field generation with various input types and proper escaping for security

Instance Method Summary collapse

Instance Method Details

#render_field(field) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/custom_form_generator/helpers/field_renderers.rb', line 14

def render_field(field)
  validate_field(field)
  field_attributes = extract_field_attributes(field)
  render_field_by_type(field, field_attributes)
rescue StandardError => e
  raise CustomFormGenerator::Error, "Failed to render field '#{field["key"]}': #{e.message}"
end