2024-04-29 00:17:15 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-03-31 16:10:47 +02:00
|
|
|
class NestedForms::OwnedButtonComponent < ApplicationComponent
|
|
|
|
renders_one :button_label
|
|
|
|
|
|
|
|
def initialize(formaction:, http_method:, opt: {})
|
|
|
|
@formaction = formaction
|
|
|
|
@http_method = http_method
|
|
|
|
@opt = opt
|
|
|
|
end
|
|
|
|
|
|
|
|
def call
|
2023-06-08 11:16:55 +02:00
|
|
|
button_tag(content, @opt.merge(formaction: @formaction, form: NestedForms::FormOwnerComponent.form_id(@http_method), data: { turbo: 'true' }))
|
2023-03-31 16:10:47 +02:00
|
|
|
end
|
|
|
|
end
|