acts_as_taggable_on and auto_complete returning no results
- by Sean Johnson
I'm using acts_as_taggable_on in a model, and am trying to implement the auto_complete plugin. It seems as though I have everything hooked up correctly, but the search isn't returning any results. Here's what I have so far:
In the view:
<%= text_field_with_auto_complete(:link, :tag_list, {}, {:tokens => ','}) %>
In the controller:
def auto_complete_for_link_tag_list
@tags = Link.tag_counts_on(:tags).where('tags.name LIKE ?', params[:link][:tag_list])
render :inline => "<%= auto_complete_result(@tags, 'name') %>", :layout => false
logger.info "#{@tags.size} tags found."
end
The logger keeps returning 0 tags, and nothing shows up in the view (yeah, the layout includes the javascript defaults).
Any thoughts or advice would be awesome.