Class: Dima::Html::FormFields
- Inherits:
-
Object
- Object
- Dima::Html::FormFields
- Defined in:
- lib/dima/html/form.rb
Overview
Form fields.
Instance Attribute Summary collapse
-
#edit ⇒ Object
Returns the value of attribute edit.
Instance Method Summary collapse
Instance Attribute Details
#edit ⇒ Object
Returns the value of attribute edit.
272 273 274 |
# File 'lib/dima/html/form.rb', line 272 def edit @edit end |
Instance Method Details
#<<(field) ⇒ Object
278 279 280 |
# File 'lib/dima/html/form.rb', line 278 def << (field) fields << field end |
#empty? ⇒ Boolean
286 287 288 |
# File 'lib/dima/html/form.rb', line 286 def empty? fields.empty? end |
#fields ⇒ Object
274 275 276 |
# File 'lib/dima/html/form.rb', line 274 def fields @fields ||= [] end |
#size ⇒ Object
282 283 284 |
# File 'lib/dima/html/form.rb', line 282 def size self.fields.size end |
#to_n ⇒ Object
290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/dima/html/form.rb', line 290 def to_n unless empty? node = Node.new(tag: 'div', attributes: { class: 'dim-column dim-col50'}) fields.each do |f| old_edit = f.edit f.edit = self.edit node << f.to_n f.edit = old_edit end node end end |