Class: Keystone::Ui::FormComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Keystone::Ui::FormComponent
- Defined in:
- app/components/keystone/ui/form_component.rb
Constant Summary collapse
- FORM_CLASSES =
"space-y-6"
Instance Method Summary collapse
- #form_options ⇒ Object
-
#initialize(action:, method: :post, multipart: false, data: nil) ⇒ FormComponent
constructor
A new instance of FormComponent.
Constructor Details
#initialize(action:, method: :post, multipart: false, data: nil) ⇒ FormComponent
Returns a new instance of FormComponent.
8 9 10 11 12 13 |
# File 'app/components/keystone/ui/form_component.rb', line 8 def initialize(action:, method: :post, multipart: false, data: nil) @action = action @method = method.to_sym @multipart = multipart @data = data end |
Instance Method Details
#form_options ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'app/components/keystone/ui/form_component.rb', line 15 def = { url: @action, method: @method, class: FORM_CLASSES, multipart: @multipart } [:data] = @data if @data end |