Anyone successfully use 3.x with jquery autocomplete and ajax/json?

I posted this same question on stackoverflow and someone pointed out that the _serialize() call had my array INSIDE another array and that if I passed my bare array to _serialize() I should get it echoed at the top level of my ajax response.

It never crossed my mind to use _serialize any other way because that’s how Bake creates it.

At first, I thought that was not the solution because even after changing it, I still had a problem and autocomplete failed.

I tried Ali’s recommendation and that worked like a charm. Ali is truly the Captain Kirk of CakePHP’s Kobayashi Maru issues.

However, later on, while cleaning up the code, removing commented debug statements, I accidentally removed the die() code, leaving the original serialize() without the array and noticed that it was working correctly.

I had noticed in earlier attempts to figure out this problem before posting here that sometimes code changes in the controller were not reflected for about a minute or so in a subsequent test. It seems as if the ajax queries/responses are being cached in some way.

Anyway. It’s working now and the solution was simply to pass the array unencapsulated to _serialize.