Add form field update capability to toggle components

This commit is contained in:
Râu Cao
2023-03-15 11:37:37 +07:00
committed by Gitea
parent e758e258a8
commit fa07978aac
5 changed files with 58 additions and 13 deletions
@@ -2,9 +2,10 @@
module FormElements
class ToggleComponent < ViewComponent::Base
def initialize(enabled:, input_enabled: true)
def initialize(enabled:, input_enabled: true, data: nil)
@enabled = !!enabled
@input_enabled = input_enabled
@data = data
end
end
end