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 Social Features in Ruby on Rails Building the Friendship UI Finding and Building Models

Find the friend specified by the friend_id param and set it to a friend instance variable. Challenge of 2/3

I have been stuck on this question for that past few days.

This is what I have put in so far:

class UserFriendshipsController < ApplicationController def new @friends = User.find(params[:friend_id]) flash[:error] = 'Friendship required' end end

Can someone explain to me what I am doing incorrectly since I am not passing the challenge.

2 Answers

I am still not passing the code challenge. This is what my code looks like now.

class UserFriendshipsController < ApplicationController
  def new
    @friend = User.find(params[:friend_id])
    flash[:error] = 'Friendship required'
  end
end