Class: Primrose::Components::Form
- Defined in:
- lib/primrose/components/form.rb
Constant Summary collapse
- TEMPLATE =
<<~ERB <form class="<%= @style_class %>" action="<%= @action %>" method="<%= @method %>"> <%= @elements.join("\n") %> </form> ERB
Instance Attribute Summary
Attributes inherited from Rose
#children, #event_handlers, #state
Instance Method Summary collapse
-
#initialize(elements:, method:, style_class: nil, action: nil, **opts) ⇒ Form
constructor
A new instance of Form.
- #render ⇒ Object
Methods inherited from Rose
#add_child, #get_binding, #handle_error, #lifecycle, #on, #render_children, #trigger
Constructor Details
#initialize(elements:, method:, style_class: nil, action: nil, **opts) ⇒ Form
Returns a new instance of Form.
10 11 12 13 14 15 16 17 |
# File 'lib/primrose/components/form.rb', line 10 def initialize(elements:, method:, style_class: nil, action: nil, **opts) @elements = elements @options = opts @style_class = style_class @action = action @method = method super() end |