Class: Dill::Form

Inherits:
FieldGroup show all
Defined in:
lib/dill/widgets/form.rb

Instance Method Summary collapse

Methods inherited from FieldGroup

check_box, default_locator, field, field_names, #fields, select, #set, text_field

Methods inherited from Widget

#absent?, action, #classes, #click, #diff, filter, filter?, find_all_in, find_in, #gone?, #has_action?, #id, #initialize, #inspect, #present?, present_in?, root, #root, selector, #text, #to_cell, #to_s, #value, widget_delegator

Methods included from Widgets::DSL

#form, #list, #widget

Methods included from WidgetParts::Container

#has_no_widget?, #has_widget?, #widget, #widgets

Methods included from WidgetParts::Struct

included

Constructor Details

This class inherits a constructor from Dill::Widget

Instance Method Details

#submit_with(attributes) ⇒ Object

Submit form with attributes.

Parameters:

  • attributes (Hash)

    the form fields and their values

Returns:

  • the current widget



12
13
14
15
# File 'lib/dill/widgets/form.rb', line 12

def submit_with(attributes)
  set attributes
  submit
end

#to_tableObject



17
18
19
20
21
22
23
24
# File 'lib/dill/widgets/form.rb', line 17

def to_table
  info = self.
    class.
    field_names.
    each_with_object({}) { |e, a| a[e.to_s] = widget(e).to_cell }

  [info]
end