Method: Tolaria::FormBuildable#searchable_select

Defined in:
lib/tolaria/form_buildable.rb

#searchable_select(method, collection, value_method, text_method, options = {}) ⇒ Object

Creates a <select> list that can be filtered by typing word fragments. Uses the jQuery Chosen plugin internally to power the user interface. Parameters are the same as Rails’s collection_select.

Special Options

  • :multiple - if set to true, the select allows more than one choice. The default is false.


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tolaria/form_buildable.rb', line 19

def searchable_select(method, collection, value_method, text_method, options = {})
  render(partial:"admin/shared/forms/searchable_select", locals: {
    f: self,
    method: method,
    collection: collection,
    value_method: value_method,
    text_method: text_method,
    options: options,
    html_options: options,
  })
end