Sha256: d1b144ed86554ea4e22376e377d8ecdf67aeb0aee10316d7282a6f84019bdb27

Contents?: true

Size: 627 Bytes

Versions: 4

Compression:

Stored size: 627 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"]',
      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

4 entries across 4 versions & 1 rubygems

Version Path
autocompl-0.1.2 test/dummy/app/assets/javascripts/makers.js
autocompl-0.1.1 test/dummy/app/assets/javascripts/makers.js
autocompl-0.1.0 test/dummy/app/assets/javascripts/makers.js
autocompl-0.0.1 test/dummy/app/assets/javascripts/makers.js