Hi is there a way to use this with a remote call to the server? Currently I have it working perfectly but only with preloaded data, e.g.
typeahead: User.all.pluck(:email)
Might get a bit cumbersome with lots of results at some point, no?
Yes. Use remote
.
Here is the doc: https://github.com/twitter/typeahead.js#remote
In it's simplest form, this could be something like:
$('#input').typeahead([{
remote: 'https://twitter.com/accounts?q=%QUERY'
}]);
... but make sure to read the docs, especially re. filter
.