class UiBibz::Ui::Core::Forms::Selects::SelectField
Create a SelectField
This element is an extend of UiBibz::Ui::Core::Component
. source : silviomoreto.github.io/bootstrap-select/examples/
Attributes¶ ↑
-
content
- Content of element -
options
- Options of element -
html_options
- Html Options of element
Options¶ ↑
You can add HTML attributes using the html_options
. You can pass arguments in options attribute:
-
status
- status of element with symbol value: (:primary
,:secondary
,:info
,:warning
,:danger
,:link
) -
option_tags
- Array, Object [required] -
size
(:xs
,:sm
,:lg
) -
append
- String, Html -
prepend
- String, Html -
connect
- Hash-
event
- String -
mode
- String -
target
- Hash-
selector
- String -
data
- Array -
url
- String
-
-
-
refresh
- Hash-
event
- String -
mode
- String -
target
- Hash-
selector
- String -
data
- Array -
url
- String
-
-
Signatures¶ ↑
UiBibz::Ui::Core::Forms::Selects::SelectField.new(content, options = {}, html_options = {}).render UiBibz::Ui::Core::Forms::Selects::SelectField.new(options = {}, html_options = {}) do content end.render
Examples¶ ↑
UiBibz::Ui::Core::Forms::Selects::SelectField.new('fruits', { option_tags: list_of_fruits }, { class: 'test' }).render UiBibz::Ui::Core::Forms::Selects::SelectField.new({ option_tags: list_of_fruits }, { class: 'test' }) do 'fruits' end.render
Helper¶ ↑
select_field(content, options = {}, html_options = {})
Private Instance Methods
See UiBibz::Ui::Core::Component.initialize
UiBibz::Ui::Core::Component#component_html_classes
# File lib/ui_bibz/ui/core/forms/selects/select_field.rb, line 67 def component_html_classes super << ['select-field', 'form-control', 'form-select', size] end
UiBibz::Ui::Core::Component#component_options
# File lib/ui_bibz/ui/core/forms/selects/select_field.rb, line 71 def component_options options[:status].nil? ? super : super.merge({ surrounded: true }) end
# File lib/ui_bibz/ui/core/forms/selects/select_field.rb, line 75 def size "form-select-#{options[:size]}" unless options[:size].nil? end