Sha256: ff3bac2348e428e445c8b99709cc7e83b7afa96e2b0e20795d1c94a7698fa94d
Contents?: true
Size: 615 Bytes
Versions: 4
Compression:
Stored size: 615 Bytes
Contents
// Place all the behaviors and hooks related to the matching controller here. // All this logic will automatically be available in application.js. $(document).ready(function() { new autoComplete({ selector: 'input[name="q"]', source: function(term, response){ $.getJSON('/products/autocomplete_endpoint', { term: term }, function(data){ term = term.toLowerCase(); var matches = []; for (i=0; i<data.length; i++) if (~data[i].toLowerCase().indexOf(term)) matches.push(data[i]); response(matches); }); } }); });
Version data entries
4 entries across 4 versions & 1 rubygems