Module: SuperForm::Fieldable::ClassMethods
- Defined in:
- lib/super_form/fieldable.rb
Instance Method Summary collapse
- #field(field_id, field_class, options = {}) ⇒ Object
- #fields ⇒ Object
- #fieldset(id) ⇒ Object
- #fieldsets ⇒ Object
Instance Method Details
#field(field_id, field_class, options = {}) ⇒ Object
36 37 38 39 |
# File 'lib/super_form/fieldable.rb', line 36 def field(field_id, field_class, = {}) field = field_class.factory(field_id, ) add_field(field) end |
#fields ⇒ Object
41 42 43 |
# File 'lib/super_form/fieldable.rb', line 41 def fields @fields ||= [] end |
#fieldset(id) ⇒ Object
45 46 47 48 49 |
# File 'lib/super_form/fieldable.rb', line 45 def fieldset(id) open_fieldset(id) yield close_fieldset end |
#fieldsets ⇒ Object
51 52 53 |
# File 'lib/super_form/fieldable.rb', line 51 def fieldsets @fieldsets ||= {} end |