# Associations

**URL:** <https://www.ruby-forum.com/t/associations/135554>\
**Category:** Rails\
**Created:** [April 23, 2008, 3:13am UTC](https://www.ruby-forum.com/t/associations/135554 "2008-04-23T03:13:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![alais](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/958977/32.png) [@alais](https://www.ruby-forum.com/u/alais)\
**Post date:** [April 23, 2008, 3:13am UTC](https://www.ruby-forum.com/t/associations/135554/1 "2008-04-23T03:13:58Z")

</div>

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.
