I use rails 3.0.3
A javascript auto complete needs data like this
{ query:\'Li\', suggestions:[\'Liberia\',\'Libyan Arab Jamahiriya\',\'Liechtenstein\'
If Adam's response won't work for you, this may do it (admittedly not the most elegant solution):
{ query:'<%= @query %>', suggestions: [<%= raw @customers.map{|c| "'#{c.firstname} #{c.lastname}'" }.join(", ") %>], data: [<%= raw @customers.map{|c| "'#{c.id}'" }.join(", ") %>] }