Class: PartyPickerInput

Inherits:
TomSelectInput
  • Object
show all
Defined in:
app/inputs/party_picker_input.rb

Instance Method Summary collapse

Methods inherited from TomSelectInput

#input_html_classes

Instance Method Details

#collectionObject



8
9
10
# File 'app/inputs/party_picker_input.rb', line 8

def collection
  Party.where(id: selected_value).pluck(:full_name, :id)
end

#input(wrapper_options = nil) ⇒ Object



2
3
4
5
6
# File 'app/inputs/party_picker_input.rb', line 2

def input(wrapper_options = nil)
  input_html_options[:data] ||= {}
  input_html_options[:data]['tom-select-suggest-url-value'] = '/parties/lookup'
  super(wrapper_options)
end