Module: Clevic::ManyField
- Defined in:
- lib/clevic/many_field.rb
Overview
Preliminary code for multi-valued fields. Not working yet.
Instance Method Summary collapse
-
#many(&block) ⇒ Object
x_to_many fields are by definition collections of other entities.
- #many_builder ⇒ Object
- #many_fields ⇒ Object
-
#many_view(&block) ⇒ Object
return an instance of Clevic::View that represents the many items for this field.
Instance Method Details
#many(&block) ⇒ Object
x_to_many fields are by definition collections of other entities
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/clevic/many_field.rb', line 6 def many( &block ) if block many_view( &block ) else many_view do |mb| # TODO should fetch this from one of the field definitions mb.plain end end end |
#many_builder ⇒ Object
17 18 19 |
# File 'lib/clevic/many_field.rb', line 17 def many_builder @many_view.builder end |
#many_fields ⇒ Object
21 22 23 |
# File 'lib/clevic/many_field.rb', line 21 def many_fields many_builder.fields end |