How to: Searchlogic and Tags

Posted by bob on Stack Overflow See other posts from Stack Overflow or by bob
Published on 2010-03-21T08:12:12Z Indexed on 2010/03/21 8:21 UTC
Read the original article Hit count: 402

Filed under:
|
|
|

I have installed searchlogic and added will_paginate etc.

I currently have a product model that has tagging enabled using the acts_as_taggable_on plugin. I want to search the tags using searchlogic.

Here is the taggable plugin page: http://github.com/mbleigh/acts-as-taggable-on

Each product has a "tag_list" that i can access using Product.tag_list

or i can access a specific tag using Product.tags[0]

I can't find the scope to use for searching however with search logic. Here is my part of my working form.

<p>
    <%= f.label :name_or_description_like, "Name" %><br />
    <%= f.text_field :name_or_description_like %>
</p>

I have tried :name_or_description_or_tagged_with_like and :name_or_description_or_tags_like and also :name_or_description_or_tags_list_like to try and get it to work but I keep have an error that says the options i have tried are not found (named scopes not found). I am wondering how I can get this working or how to create my own named_scope that would allow me to search the tags added to each product by the taggable plugin.

Thanks!

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about tags