Forum: Ruby on Rails acts_as_taggable with only 1 taggings 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.
Andreas (Guest)
on 2006-04-10 16:04
I was reading rails recipes and it shows how to use acts_as_taggable
with only 2 tables, a tags and a taggings table.
But I think that its related to an older acts_as_taggable version
because now it seems that it works with one tags table and one taggings
table for each tagable model, like this:

tags
photos
tags_photos

Which means I need one new table for each model I want to tag.

Isn't there a way to use only 1 table with the taggings, to have a
centralized table for all kinds of items I want to tag?

I read the documentation and I think its possible using the
join_class_name option, but I didn't manage to work it out. Can anyone
please explain how its done, and please don't forget how the table
structure works.

Thanks
Tom M. (Guest)
on 2006-04-10 19:13
(Received via mailing list)
There are two acts_as_taggle plugins, the original gem
and the newer plugin.

The gem uses a tags table and a HABTM table between a
tags table and the table that you want to be taggable.

The newer plugin uses a two table design and is based
upon some post 1.0 features.

--
-- Tom M.
Andreas (Guest)
on 2006-04-10 20:21
Tom M. wrote:
> There are two acts_as_taggle plugins, the original gem
> and the newer plugin.
>
> The gem uses a tags table and a HABTM table between a
> tags table and the table that you want to be taggable.
>
> The newer plugin uses a two table design and is based
> upon some post 1.0 features.
>
> --
> -- Tom M.

Thanks a lot, thats correct, here's a link in case anyone else is stuck
on that: http://www.notio.com/2006/02/rails_acts_as_t.html
This topic is locked and can not be replied to.