Class: Playbook::Forms::Builder::ActionArea
- Inherits:
-
Object
- Object
- Playbook::Forms::Builder::ActionArea
- Defined in:
- lib/playbook/forms/builder/action_area.rb
Instance Method Summary collapse
- #button(_value = nil, props:) ⇒ Object
-
#initialize(view_context, submit_default_value) ⇒ ActionArea
constructor
A new instance of ActionArea.
- #submit(value = nil, props: {}) ⇒ Object
Constructor Details
#initialize(view_context, submit_default_value) ⇒ ActionArea
Returns a new instance of ActionArea.
7 8 9 10 |
# File 'lib/playbook/forms/builder/action_area.rb', line 7 def initialize(view_context, submit_default_value) self.view_context = view_context self.submit_default_value = submit_default_value end |
Instance Method Details
#button(_value = nil, props:) ⇒ Object
19 20 21 22 23 |
# File 'lib/playbook/forms/builder/action_area.rb', line 19 def (_value = nil, props:) view_context.content_tag(:li) do view_context.pb_rails("button", props: props) end end |
#submit(value = nil, props: {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/playbook/forms/builder/action_area.rb', line 12 def submit(value = nil, props: {}) props[:type] ||= "submit" props[:text] ||= value || submit_default_value (value, props: props) end |