Topic: Autocomplete issue after changes to table
I used to have a working autocomplete feature in my app using:
@items = Item.find(:all, :conditions => ['name LIKE ?',
'%' + params[:search].to_s + '%'])
render :inline => "<%= auto_complete_result(@items, 'name') %>"
However, I decided to move the 'name' attribute out of the items-table and put it in an 'itemstats'-table.
So I changed the first line into:
@items = Item.find(:all, :include => :itemstat,
:conditions => ['name LIKE ? AND open = ?', '%' + params[:search].to_s + '%', true])
But I am clueless as to how I can get the 'name' attribute to show in the result. I attempted things like 'itemstat.name', but that didn't work.