Class: PartyPickerTomSelectInput
- Inherits:
-
TomSelectInput
- Object
- SimpleForm::Inputs::CollectionSelectInput
- TomSelectInput
- PartyPickerTomSelectInput
- Defined in:
- app/inputs/party_picker_tom_select_input.rb
Overview
Tom Select version of PartyPickerInput
Use as: :party_picker_tom_select instead of :party_picker
Instance Method Summary collapse
Methods inherited from TomSelectInput
Instance Method Details
#collection ⇒ Object
12 13 14 15 16 |
# File 'app/inputs/party_picker_tom_select_input.rb', line 12 def collection return [] unless selected_value Party.where(id: selected_value).pluck(:full_name, :id) end |
#input(wrapper_options = nil) ⇒ Object
4 5 6 7 8 9 10 |
# File 'app/inputs/party_picker_tom_select_input.rb', line 4 def input( = nil) [:data] ||= {} [:data]['tom-select-suggest-url-value'] = '/parties/lookup' [:data]['tom-select-min-chars-value'] = 0 super end |