Click a link and insert into a database?

Ya setting it up properly is a bit complex for new rails programmers.

Here's another really good source:
http://blog.hasmanythrough.com/articles/2006/04/21/self-referential-through.
Scroll down to see a "friends" example in the user comments.

Basically you've got a user table (nodes) and are connecting users
inside that table with each other through "friendships" (edges).

Cheers,
Chad