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
Kelley Kent
33,450 PointsBuilding 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
Kelley Kent
33,450 PointsI 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 :(
ecp
838 PointsHi 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
Jody Albritton
Courses Plus Student 5,497 PointsKelley Kent
33,450 PointsThanks Jody! That worked :)