Class: Inputs::EffectiveSelect::Input
Instance Method Summary
collapse
#field_name, #initialize, #value
Instance Method Details
10
11
12
|
# File 'app/models/inputs/effective_select/input.rb', line 10
def default_input_classes
[:effective_select]
end
|
6
7
8
|
# File 'app/models/inputs/effective_select/input.rb', line 6
def default_input_js_options
{:theme => 'bootstrap', :minimumResultsForSearch => 6, :tokenSeparators => [',', ' '], :width => 'style'}
end
|
#options ⇒ Object
18
19
20
21
22
23
24
25
26
|
# File 'app/models/inputs/effective_select/input.rb', line 18
def options
super do |options|
options[:multiple] = true if options[:tags]
options['data-input-js-options'][:allowClear] = (!options[:multiple])
options[:include_blank] = false if options[:multiple]
end
end
|
#to_html ⇒ Object
14
15
16
|
# File 'app/models/inputs/effective_select/input.rb', line 14
def to_html
collection_select(@object_name, @method, options.delete(:collection), options.delete(:label_method), options.delete(:value_method), options.merge({:selected => value}), options)
end
|