Class: Shadcn::NativeSelectComponent::OptgroupComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Shadcn::NativeSelectComponent::OptgroupComponent
- Defined in:
- app/components/shadcn/native_select_component.rb
Overview
Optgroup subcomponent
Instance Attribute Summary
Attributes inherited from BaseComponent
#class_name, #data, #html_options
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(label:, disabled: false, **options) ⇒ OptgroupComponent
constructor
A new instance of OptgroupComponent.
Methods inherited from BaseComponent
Methods included from Rails::Helpers::ClassNameHelper
Constructor Details
#initialize(label:, disabled: false, **options) ⇒ OptgroupComponent
Returns a new instance of OptgroupComponent.
107 108 109 110 111 |
# File 'app/components/shadcn/native_select_component.rb', line 107 def initialize(label:, disabled: false, **) super(**) @label = label @disabled = disabled end |
Instance Method Details
#call ⇒ Object
113 114 115 116 117 |
# File 'app/components/shadcn/native_select_component.rb', line 113 def call tag.optgroup(label: @label, disabled: @disabled || nil, **.merge(build_data).compact) do safe_join() end end |