Module: AutocompleteSelect::Helper
- Defined in:
- lib/autocomplete_select/helper.rb
Instance Method Summary collapse
- #autocomplete_select_options(path, label_or_options = nil, args) ⇒ Object
- #autocomplete_select_tag(name, path, value = nil, label_or_options = nil, *args) ⇒ Object
Instance Method Details
#autocomplete_select_options(path, label_or_options = nil, args) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/autocomplete_select/helper.rb', line 3 def (path, = nil, args) if .is_a?(Hash) = else label = = args.shift end = args.shift || {} ||= {} [:source] = path [:label] = label if label .deep_merge({ :data => { :"autocomplete-select" => .to_json } }) end |
#autocomplete_select_tag(name, path, value = nil, label_or_options = nil, *args) ⇒ Object
22 23 24 |
# File 'lib/autocomplete_select/helper.rb', line 22 def autocomplete_select_tag(name, path, value = nil, = nil, *args) text_field_tag(name, value, (path, , args)) end |