Class: Playbook::PbForm::FormBuilder::ActionArea

Inherits:
Object
  • Object
show all
Defined in:
app/pb_kits/playbook/pb_form/form_builder/action_area.rb

Instance Method Summary collapse

Constructor Details

#initialize(form_builder) ⇒ ActionArea

Returns a new instance of ActionArea.



7
8
9
# File 'app/pb_kits/playbook/pb_form/form_builder/action_area.rb', line 7

def initialize(form_builder)
  self.form_builder = form_builder
end

Instance Method Details

#button(value = nil, props:) ⇒ Object



16
17
18
19
20
21
22
# File 'app/pb_kits/playbook/pb_form/form_builder/action_area.rb', line 16

def button(value = nil, props:)
  props[:text] ||= value || form_builder.send(:submit_default_value)

  template.(:li) do
    template.pb_rails("button", props: props)
  end
end

#submit(value = nil, props: {}) ⇒ Object



11
12
13
14
# File 'app/pb_kits/playbook/pb_form/form_builder/action_area.rb', line 11

def submit(value = nil, props: {})
  props[:type] ||= "submit"
  button(value, props: props)
end

#wrapperObject



24
25
26
27
28
# File 'app/pb_kits/playbook/pb_form/form_builder/action_area.rb', line 24

def wrapper
  template.(:ol, class: "pb-form-actions") do
    yield self
  end
end