-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselect.rb
More file actions
35 lines (31 loc) · 954 Bytes
/
select.rb
File metadata and controls
35 lines (31 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true
module Flowbite
class InputField
class Select < InputField
def initialize(attribute:, form:, collection: [], disabled: false, hint: nil, include_blank: false, input: {}, label: {}, multiple: false, size: :default)
super(attribute: attribute, disabled: disabled, form: form, hint: hint, input: input, label: label, size: size)
@collection = collection
@include_blank = include_blank
@multiple = multiple
end
def input
render(
input_component.new(
attribute: @attribute,
collection: @collection,
disabled: @disabled,
form: @form,
include_blank: @include_blank,
multiple: @multiple,
options: input_options,
size: @size
)
)
end
private
def input_component
::Flowbite::Input::Select
end
end
end
end