2
3
4
5
6
7
8
9
10
11
12
13
|
# File 'app/inputs/source_picker_input.rb', line 2
def input(wrapper_options = nil)
params = {}
params[:unrestricted] = true if input_html_options.dig(:data, :unrestricted).to_b
params[:source_id_not_in] = input_html_options.dig(:data, :source_id_not_in)
url = Web::UrlBuilder.new.process("/sources/lookup", nil, parameters: params)
input_html_options[:multiple] = false if input_html_options[:multiple].nil?
input_html_options[:data] ||= {}
input_html_options[:data]['tom-select-suggest-url-value'] = url
input_html_options[:data]['tom-select-min-chars-value'] = 0
input_html_options[:data]['tom-select-preload-value'] = true
super(wrapper_options)
end
|