Forum: Ruby on Rails acts_as_taggable scoped in another class/table?

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.
225614451dc9aee33be11e0f6876c18b?d=identicon&s=25 Raymond Brigleb (Guest)
on 2006-02-14 00:42
(Received via mailing list)
I'm hoping someone more familiar with DHH's acts_as_taggable plugin
can help me out here...

Tags being all the rage, and the subject of a good recipe in the
forthcoming Pragmatic Rails Recipes book, I decided to give them a
try. However, from what I can tell, they're kind of application-wide
by design. I know the social thing is hot, but I need my tags to be
specific to another table - specific to each user, rather than shared
between all.

For example, say my User model has all my accounts, and my Categories
model has:

   acts_as_list :scope => :user

which works like I want, I can sort my Categories within Users. But
then, wanting to do the same thing with tags applied to Users, I try:

   acts_as_taggable :scope => :website

But this doesn't seem to work. I can do something like this to find
Tags applied to my Category:

   Tag.find_by_name(tag_name).tagged

Yet how do I ask for all Tags used by a single User?
93f88cba0d39b0501c8057f6dcb4bdbc?d=identicon&s=25 Toby Sterrett (Guest)
on 2006-02-14 00:56
(Received via mailing list)
On Feb 13, 2006, at 3:41 PM, Raymond Brigleb wrote:

> Yet how do I ask for all Tags used by a single User?

I was just wondering the same thing, glad this got brought up. I'd
imagine that the taggings or tags db table would have to be altered
to hold the attribution, and the code would have to be changed to
record it. What's the practice for modifying plugins like this?

Toby
This topic is locked and can not be replied to.