Associations

I have a list of tags. I’d like to put labels on the tags (tag the
tags?) and group them. group.rb: has_many :tags, tag.rb: has_many
:groups, etc.

I would also like to associate groups with other groups. For example, if
there are tags “light blue” and “dark blue”, they would be grouped in a
group called “blue”, and there would be a separate group that would
contain the tags “dark red”, “light purple”, AND the group “blue.”

Currently I have a table groups and a table tags and a table to link
them called groups_tags that consist of group_id and tag_id. What’s the
best way to implement this in Rails?

Thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs