Recently I started using https://github.com/crowdint/rails3-jquery-autocomplete
It works great, but I was trying to set a scope for the results that I was autocompleteing, in this question I got a good answer: Scoping the results for rails3 jquery autocomplete plugin
Using Claudio's code I've successfully scoped as such:
class PostsController < ApplicationController
autocomplete :post, :title
def get_items(parameters)
Post.where(:user_id => current_user.id)
end
This works because I'm overwriting the plugin's get_items method. Which you can see here: https://github.com/crowdint/rails3-jquery-autocomplete/commit/b3c18ac92ced2932ac6e9d17237343b512d2144d#L1R84 (I have a version before this commit, so get_items still works for me).
The problem with my scope, is the autocomplete functionality no longer works. When the person starts typing, the list specified in get_items just pops up, rather than items being suggested from that list.
I'm assuming I'm doing something wrong with my overwriting method. Any ideas?
Best, Elliot