Typeahead for rails with remote data -


currently typeahead works on local machine thise

$(document).ready(function(d){ var companies = new bloodhound({     datumtokenizer: bloodhound.tokenizers.obj.whitespace('value'),     querytokenizer: bloodhound.tokenizers.whitespace,     remote: {         //url: '/javascripts/company_list.json',         url: 'http://localhost:3000/?utf8=%e2%9c%93&search=%query'     } }); 

i wondering if did url part correctly? works that, feel hardcoded , wanted know best way handle if move heroku. thanks!

var departaments = new bloodhound({     datumtokenizer: function(d) {         return bloodhound.tokenizers.whitespace(d.value);        },querytokenizer: bloodhound.tokenizers.whitespace,     limit: 6,     remote: '/departaments?value=%query' }); 

with works me, in case maybe is

remote: '/?value=%query'


Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -