title: twitter bootstrap typeahead (method 'toLowerCase' of undefined)
body: <p>I am trying to use twitter bootstrap to get the manufacturers from my DB.</p>
  
  <p>Because twitter bootstrap typeahead does not support ajax calls I am using this fork: </p>
  
  <p><a href="https://gist.github.com/1866577" rel="nofollow noreferrer">https://gist.github.com/1866577</a></p>
  
  <p>In that page there is this <a href="https://gist.github.com/1866577#gistcomment-307488" rel="nofollow noreferrer">comment</a> that mentions how to do exactly what I want to do. The problem is when I run my code I keep on getting:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot call method 'toLowerCase' of undefined </p>
  </blockquote>
  
  <p>I googled around and came tried changing my jquery file to both using the minified and non minified as well as the one hosted on google code and I kept getting the same error.</p>
  
  <p>My code currently is as follows:</p>
  
  <pre><code>$('#manufacturer').typeahead({
      source: function(typeahead, query){
          $.ajax({
              url: window.location.origin+"/bows/get_manufacturers.json",
              type: "POST",
              data: "",
              dataType: "JSON",
              async: false,
              success: function(results){
                  var manufacturers = new Array;
                  $.map(results.data.manufacturers, function(data, item){
                      var group;
                      group = {
                          manufacturer_id: data.Manufacturer.id,
                          manufacturer: data.Manufacturer.manufacturer
                      };
                      manufacturers.push(group);
                  });
                  typeahead.process(manufacturers);
              }
          });
      },
      property: 'name',
      items:11,
      onselect: function (obj) {
  
      }
  });
  </code></pre>
  
  <p>on the url field I added the </p>
  
  <blockquote>
    <p>window.location.origin </p>
  </blockquote>
  
  <p>to avoid any problems as already discussed on another question</p>
  
  <p>Also before I was using <code>$.each()</code> and then decided to use <code>$.map()</code> as recomended Tomislav Markovski in a <a href="https://stackoverflow.com/questions/9232748/twitter-bootstrap-typeahead-ajax-example/11147113#comment14731742_11147113">similar question</a></p>
  
  <p>Anyone has any idea why I keep getting this problem?! </p>
  
  <p>Thank you</p>