Sha256: 08dba1ca5eca7ae6468c13bb588e6b0aa62676d80e307c312855bcac16be80a3

Contents?: true

Size: 646 Bytes

Versions: 3

Compression:

Stored size: 646 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="maker_index_form"]',
      minChars: 1,
      source: function(term, response){
          $.getJSON('/makers/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

3 entries across 3 versions & 1 rubygems

Version Path
autocompl-0.2.2 test/dummy/app/assets/javascripts/makers.js
autocompl-0.2.1 test/dummy/app/assets/javascripts/makers.js
autocompl-0.2.0 test/dummy/app/assets/javascripts/makers.js