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

Creating the Friendship Form

when I go to create the link on my show.html.erb page so we can debug the error I am getting an undefined method new_user_friendship_path error when I refresh the page. Any ideas? Code I have.

 <%= link_to "Add Friend", new_user_friendship_path(friend_id: @user) %>

2 Answers

Are you sure it's defined in your routes.rb file? That's where I would look first. The link doesn't know where "new_user_friendship_path" is supposed to go.

Well the only thing the video had me update in the routes was add as: 'profile' to the following to look like this

 get '/:id', to: 'profiles#show', as: 'profile'

I have triple checked the video and it doesn't show anything being added to the routes besides what I did add already.

Ok it was as simple as me missing an s on resources in the routes file. Problem Solved