Friends

Forums > Book - Chapter 9 > Friends

Login to post a new topic

Author Message
lostcaggy
Member since 23 Aug 20:38
0 posts

I’ve got a copy of the code and of the book, have got the code running locally on my machine. I’ve created a couple of users. When I click on My Friends. I get my name at the top and then a blank page. How do friend get added.

tmkouba
Member since 05 Feb 16:30
0 posts

Unless I’ve missed a few pages in the book, you’ve done everything correctly; it is working the way it was designed. If you click on the “My Friends” link on this railscoders.net site, and if you don’t already have friends, you’ll receive the blank page too. On page 274 in the “further development” section, fourth bullet, Alan eludes to this when he talks about how friends are added.
We wouldn’t want to show a list of all of the other users on the system and let you select which ones you want as friends because that could be construed as a privacy and even a security violation. Adding a friend is usually done by “invite” only.
The way it’s currently coded, you can only add a friend by typing in the URL as noted on page 264: http://localhost:3000/users/1/friends/new?friend_id=2. This opens the “Add a new friend” page.
This makes Chapter 9 a tad incomplete in the sense that it is great in showing you how to make friendship relationships and how to display, categorize and delete friends, but it doesn’t really show you how to add friends. And if you can’t add friends, being able to view your friends becomes secondary.
Note to Alan, unless I’ve totally missed a few pages in the book, you may want to either be more explicit about the fact that adding a friend is done by URL only or include the code to add a friend through “invite”. Without one of these, the chapter feels incomplete and is a slight letdown.
Terri

eric
Member since 09 Feb 21:40
0 posts

Actually, as I’ve read, when you view a user’s profile you can add them as a friend.