Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Building the Friendship UI

Hi,

I am having problems with the Building the Friendship UI lessons under Building Social Features in Ruby on Rails. The code challenges Finding and Building Models, Saving Models and Redirecting,and Testing Controller responses gave me some troubles. I was able to get through the first two challenges on Finding and Building Models but could not get the right answer for number 3. Could you provide any help? Also, for the second two (Saving Models and Redirecting and Testing Controller Responses) I was not able to see which videos explained how to do the code challenges-it didn't seem like the videos right before the challenges lined up. Any help would be greatly appreciated.

Thanks!

4 Answers

I guess to clarify a little more, for the Finding and Building Models question #3, it says this: Create a new UserFriendship instance variable set to user_friendship with the user set to the current_user and the friend set to the @friend instance variable.

And my answer was this: class UserFriendshipsController < ApplicationController def new if params[:friend_id] @friend=User.find(params[:friend_id]) @user_friendship=current_user.user_friendships.new(friend:@friend) else flash[:error]= "Friend required" end end end

Which I feel like is correct but I keep getting it wrong :(

Hi Kelly,

These are great questions - and we really appreciate you posting on the Forums :)

I'll be getting in touch with Jim and Jason about this Forum post shortly, but would you be able to email us at help@teamtreehouse.com with screenshots or links to the code challenges you've had difficulties with - and maybe a bit more detail? We're happy to help :)

Thanks a bunch! :D

Thanks Jody! That worked :)