Skip to content

Tagging with Ruby on Rails

Posted on 18 March 2006

Large credit goes out to The Rails Diary for helping me get the tags going on this site.

I wanted a many to many relationship between the aritcles and tags so that the tags wouldn't be duplicated in the database. The Has and Belongs To Many relationship (HaBTM) in Rails is what I used, with a link table to contain the ID's from the Articles and Tags tables.

For a full tutorial i'd check out the 'Tagging and HaBTM Relationships' article on the Rails Diary. Keep in mind a follow up article was written called 'The Redux' that is definitely worth a read as well.

View the snippets archive ››

No comments have been left

Got something to say?

About

Paul is a web developer for Kyanmedia web agency. He's lucky enough to write in Ruby on Rails full-time and uses this site to post snippets of code.

Contact

my name at gmail.com

More snippets

Take a look in the archive

Need a website?

Contact my employer. Make sure to check out our portfolio of work.

Hosting

I recommend hostingrails.com