Class: OpportunityPickerInput

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

Instance Method Summary collapse

Methods inherited from TomSelectInput

#input_html_classes

Instance Method Details

#collectionObject



9
10
11
# File 'app/inputs/opportunity_picker_input.rb', line 9

def collection
  Opportunity.where(id: selected_value).pluck(:name, :id)
end

#input(wrapper_options = nil) ⇒ Object



3
4
5
6
7
# File 'app/inputs/opportunity_picker_input.rb', line 3

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