Course

Building Social Features in Ruby on Rails

In our first Ruby on Rails project, we started building a simple social network called Treebook. Now we're ready to add friendships, friend lists, and AJAX features using intermediate features of the Ruby on Rails application framework.

Building Social Features in Ruby on Rails

5 Achievements

Creating Friendships

Creating Friendships

Let's add social features to Treebook! In this stage we're going to add friendships to our Treebook application. We'll start by creating a friendship model as well as learn what a join model and join table are.

Building the Friendship UI

Building the Friendship UI

Now that we have our friendship models created and tested, we need to build the front-end to let users friend each other. We'll start by creating a controller for user friendships and integrating that in to the application routes. Finally, we'll hook up the models to the new controller.

Adding State

Adding State

It is important to be able to respond to different events in our friendship model. For example, when a user sends a friend request to another user, we want the requestee to get an email. We're going to use something called a state machine to manage this.

Using AJAX

Using AJAX

Treebook is now working pretty well and allows users to friend each other. With all of this functionality in place, let's spice things up by adding some AJAX to our site for remote JavaScript interactions.

0 of 9 Steps Complete
Managing Friendships

Managing Friendships

In this stage, we're going to allow users to manage their friends. We'll provide a new interface for listing, deleting, and blocking friends.

0 of 8 Steps Complete

Instructors

  • Jason Seifer

    When not fighting web crime, Jason Seifer is a teacher at Treehouse. He's passionate about the web and programming. You can find Jason on Twitter at @jseifer and on his personal blog at jasonseifer.com.

  • Andrew Chalkley

    I'm an alien, I'm a legal alien, I'm an Englishman in Portland. All of my professional life I've worked with computers online. I'm a polyglot programmer and like using the right tools for the job. In my spare time I enjoy spending time with my young family and when I get chance, sticking opponents in Halo 4. You can find me in most places @chalkers.

Download videos

You have to sign up for Treehouse in order to download course videos.

Sign up