I can't understand how to use variables initialized in the controller, for example, to jQuery script (autocomplete in my case). So I'm using Rails and get my authors list. How can I refernce them in jQuery script where I' d like to use jQuery autocomplete plugin like that:
[code] $(document).ready(function() { $("#book_author").autocomplete(url or data, options ); }); [/code] So I should pass my authors array from the controler to the script. How to do that?