I am using jquery-rails-autocomplete and want to have autocomplete on more than one column.
routes.rb
get 'welcome/autocomplete_brand_name_id'
Controller
autocomplete :brand, [:name, :id]
View
<%= form_tag do %>
<%=text_field_tag 'name', '', :autocomplete => welcome_autocomplete_brand_name_id_path %>
<% end %>
Model
class Brand < ActiveRecord::Base
end
However, in my autocomplete it give me error that autocomplete_brand_name_id method not found.
If I use sane code for only :name or only :id than it work fine. Not sure what going on?
The multi column search you are trying to use is still in a pull request (https://github.com/crowdint/rails3-jquery-autocomplete/pull/95 ) which has not been merged yet.
Basically, it means that this functionality is not yet in the gem nor even in the repo.
If you really want it, you can checkout the official repo and pull the changes specified in that pull request but you must understand that there might be a reason why the maintainer of rails3-jquery-autocomplete hasn’t done it.