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 trialAlex Alex
Courses Plus Student 2,176 PointsBlocking UI
Hello,
Does anyone knows where the accepted_user_franships method was defined, because I called mine accept, and I don't remembered where I defined it.
Thanks
4 Answers
Jason Seifer
Treehouse Guest TeacherHey Alex Alex try checking your user_friendships_controller and user_friendship model.
Alex Alex
Courses Plus Student 2,176 PointsI fixed this, the problem was in user model.
Unsubscribed User
8,167 PointsThanks for the post! I actually had the same problem, just forgot to update my user modal as well!
Tyson P
5,512 Pointsforgot to add this to user.rb model:
has_many :accepted_user_friendships, class_name: 'UserFriendship', foreign_key: :user_id, conditions: { state: 'accepted' } has_many :accepted_friends, through: :accepted_user_friendships, source: :friend