I am using Rails 3 and I would like to create an application that works like a thesaurus. I have read some tutorials on how to do has-and-belongs-to-many (HABTM) relationships, but I’m not sure how to configure my models such that one “item” has and belongs to many other items, i.e. its synonyms.
I suppose what I’m trying to do is a bit like a “related posts” section in a blog, where at the back-end each post must have several “related posts”.
I’d look at this as a many-to-many relationship where you need a separate model to handle the relationship.
Then you’d just need to do something like this to create / display words & synonyms: