Chapter 14. Friendships

With the double-blind email system in place, we suppose that RailsSpace is now technically a social network, but most real-world social networks worthy of the name give users a way to select preferred members. Following tradition, we call such distinguished users friends. Adding friends to RailsSpace is the goal of this chapter.

Friendships represent the most challenging data modeling problem we’ve encountered so far. To solve it, we’ll have to learn about simulated table names, foreign keys, and the has_many database association. Adding and managing friendships will then take place through both email and web interfaces. By the end of the chapter, we’ll be in a position to put a list of friends on the hub and user profile, ...

Get RailsSpace: Building a Social Networking Website with Ruby on Rails™ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.