
So, for shits and giggles I decided to build (or really—just hook up) some basic tagging functionality this morning to this site. I was supposed to be doing “real work” but was having a little trouble getting motivated… This made for a fine distraction.
Now, I say “hook up”, because that’s just about all there is to it. You don’t actually have to do much of anything. I decided to use the built-in rails tagging plugin and, once it was installed, I made a slight tweak to the database for the new tables, made a slight tweak to the entries controller, and then, boom… you got “tags”1.
I find it shockingly simple that once it’s setup, you simply call object.tag_with(tags) to set tags on an object, and then object.tag_list to retrieve them.
In fact, it’s so simple, that I actually don’t quite trust it—and I’m finding myself reaching this state more and more, the longer I tinker with rails. Many things are just so easy, that I immediately distrust them, and end up spending a bunch of time diving into the source and dissecting them to see just what in the hell is going on.
Maybe I’m just finally getting too old and cynical. You damned kids keep your rails off my lawn.
1And for the record, I’m not convinced “tags” are any great metaphor either… Stupid web 2.0.