Question: I'm using the Rails gem rails3-jquery-autocomplete to add categories to posts. 

I would like to restrict the search to include only categories that belong to the current user or post's author in the results.

The documentation says that I can specify a scope:

> 
> :scopes
> 
> 
> Added option to use scopes. Pass scopes in an array. e.g :scopes =>
>  [:scope1, :scope2]
> 
> 
> 

But I'm not sure how I would pass the user id here? 

It seems like a comon scenario, am I missing something obvious?

I found an answer that suggests modifying the `get_item` method, but that seems to break the auto-complete

[Scoping the results for rails3 jquery autocomplete plugin](https://stackoverflow.com/questions/4858816/scoping-the-results-for-rails3-jquery-autocomplete-plugin)

Answer: 
To answer the question posed by @ctilley79, multiple autocompletes is not a problem because, in addition to the possibility of passing more values in the params hash, you also have access to the autocomplete parameters. On my form (as an example), I have both a City and a Zip autocomplete. I need to restrict the City to those in a certain state. So my controller action looks like this:

```
def get_autocomplete_items(parameters)
  if (parameters[:model] == City)
    super(parameters).where("state_id" => params[:state_id])
  else
    super(parameters)
  end
end

```

You also have access to the method in case you need it. Do logger.debug on the parameters to see all that is available.
I faced a similar problem. Our site is multi-tenant, so everything needs to be scoped to the tenant. 

To make this easier, I modified rails3-jquery-autocomplete to accept another option called :base\_scope. It takes a string, that gets eval'd instead of using the model. All the other functionality works, so you can append additional scopes and where clauses if you need to. 

My fork is here: <https://github.com/GiveCorps/rails3-jquery-autocomplete>

I am not sure that the tests i wrote prove it will always work. I just checked that it was using the scope instead of the model in the items method. 

i would appreciate any thoughts on it. Not sure whether it merits a pull request.