Displaying 2 results from an estimated 2 matches for "items_tags".
2006 Dec 11
2
join and sort on 'best match'
Hi Everybody,
I have been breaking my head on the following problem: how to join 2
tables and sort the results on the best match.
explanation:
- there are 3 tables, items, tags and items_tags. The items_tags table
links items to tags.
- I have one item which has certain tags, and I want to look up all the
other items that have those tags as well
- results should be sorted and presented by ''best match'': first all the
items that have 3 tags in common, then 2 and last 1...
2006 Jan 20
6
HELP: acts_as_taggable problem with :clear => true
...clear => true on the tags method, because the tags I''m supplying as
parameters are the complete set of tags for the item, not additions to
existing tags.
Problem is, that gives me a nasty SQL error ...
Unknown column ''id'' in ''where clause'': UPDATE items_tags SET item_id =
NULL WHERE (item_id = 2 AND id IN (NULL,NULL,NULL,NULL,NULL,NULL,NULL))
Any ideas ?
My call to tags (in update method in controller) is like this
@item.tag(params[:tags], :clear => true )
Acts_as_taggable is invoked like this
acts_as_taggable :join_class_name => '...