Class: Playbook::PbForm::FormBuilder::ActionArea
- Inherits:
-
Object
- Object
- Playbook::PbForm::FormBuilder::ActionArea
- Defined in:
- app/pb_kits/playbook/pb_form/form_builder/action_area.rb
Instance Method Summary collapse
- #button(value = nil, props:) ⇒ Object
-
#initialize(form_builder) ⇒ ActionArea
constructor
A new instance of ActionArea.
- #submit(value = nil, props: {}) ⇒ Object
- #wrapper ⇒ Object
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 (value = nil, props:) props[:text] ||= value || form_builder.send(:submit_default_value) template.content_tag(: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" (value, props: props) end |
#wrapper ⇒ Object
24 25 26 27 28 |
# File 'app/pb_kits/playbook/pb_form/form_builder/action_area.rb', line 24 def wrapper template.content_tag(:ol, class: "pb-form-actions") do yield self end end |