Forum: Ruby on Rails acts_as_taggable - adding users and normalizing tags

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
19c9af375aca3001e3978cb16684803c?d=identicon&s=25 Parker Thompson (Guest)
on 2005-12-24 22:31
(Received via mailing list)
Hey all,

I'm wondering how people are using acts_as_taggable.  Two things I'd
like to do that aren't supported out of the box are tag normalization
and user attribution.  I can't imagine I'm the first to think about
doing this.

>From a schema perspective these things both seem simple, just put the
normalized tag in the tags table, and have a join table that contains
a user id and the denormalized version (i.e. tags -> "swat",
tags_to_XXX -> "S.W.A.T").

But, when I get to the coding part it gets a bit ugly.  Optimally I'd
like to:

  @thing.tag(user_input, :normalize => true, :user => @user)

where this causes the join table (tags_XXXX) to have its user_id fk
set, and populate a 'denormalized' field with "S.W.A.T" so that I can
display whatever the user typed on his/her pages.

Anybody got some code they want to share, or should I just start
hacking on taggable?

Thanks,

pt.
--
Parker Thompson
http://www.parkert.com/
510.541.0125
This topic is locked and can not be replied to.