Class: Flowbite::InputField::Select

Inherits:
Flowbite::InputField show all
Defined in:
app/components/flowbite/input_field/select.rb

Instance Method Summary collapse

Methods inherited from Flowbite::InputField

#errors

Constructor Details

#initialize(attribute:, form:, collection: [], disabled: false, hint: nil, input: {}, label: {}, size: :default) ⇒ Select

Returns a new instance of Select.



6
7
8
9
# File 'app/components/flowbite/input_field/select.rb', line 6

def initialize(attribute:, form:, collection: [], disabled: false, hint: nil, input: {}, label: {}, size: :default)
  super(attribute: attribute, disabled: disabled, form: form, hint: hint, input: input, label: label, size: size)
  @collection = collection
end

Instance Method Details

#inputObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/components/flowbite/input_field/select.rb', line 11

def input
  render(
    input_component.new(
      attribute: @attribute,
      collection: @collection,
      disabled: @disabled,
      form: @form,
      options: input_options,
      size: @size
    )
  )
end