Class: Fluxbit::Form::SelectFreeInputComponent
- Inherits:
-
Component
- Object
- Component
- Fluxbit::Form::SelectFreeInputComponent
- Defined in:
- app/components/fluxbit/form/select_free_input_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(free_option: "Specify...", **kwargs, &block) ⇒ SelectFreeInputComponent
constructor
A new instance of SelectFreeInputComponent.
Constructor Details
#initialize(free_option: "Specify...", **kwargs, &block) ⇒ SelectFreeInputComponent
4 5 6 7 8 9 10 |
# File 'app/components/fluxbit/form/select_free_input_component.rb', line 4 def initialize(free_option: "Specify...", **kwargs, &block) super @kwargs = kwargs @block = block @free_option = free_option end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/components/fluxbit/form/select_free_input_component.rb', line 12 def call if @kwargs[:with_content] content = @kwargs.delete(:with_content) content_tag :div do concat render(Fluxbit::Form::SelectInputComponent.new(**select_params).with_content(content), &@block) concat render(Fluxbit::Form::TextInputComponent.new(**text_params).with_content(content), &@block) end else content_tag :div do concat render(Fluxbit::Form::SelectInputComponent.new(**select_params), &@block) concat render(Fluxbit::Form::TextInputComponent.new(**text_params), &@block) end end end |