Module: Tramway::Utils::Field
- Included in:
- Tailwinds::Form::Builder
- Defined in:
- lib/tramway/utils/field.rb
Overview
Provides dynamic field rendering
Instance Method Summary collapse
Instance Method Details
#tramway_field(field_data, attribute, **options) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/tramway/utils/field.rb', line 7 def tramway_field(field_data, attribute, **, &) input_type = field_type(field_data) input_name = field_name input_type = (field_data).merge() case input_type.to_sym when :select, :multiselect collection = .delete(:collection) public_send(input_name, attribute, collection, **, &) else public_send(input_name, attribute, **, &) end end |