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

Deleted User

Creating the Friendship Form

Can't seem to get past creating the friendship form section. I get the following error while clicking on the image tag in the browser:

undefined method `new_user_friendship_path' for #         <#<Class:0x007fa9135f9ab0>:0x007fa915e7dd60>
Extracted source (around line #3):

1: <div class = "page-header">
2:  <h1><%= @user.full_name % > </h1>
3: <%= link_to "Add Friend",    new_user_friendship_path(friend_id:   @user), class: 'btn' %>
4: </div>
5: 
6: <% if @statuses %>

Here is the code in my show.html.erb file

<div class = "page-header">
<h1><%= @user.full_name %></h1>
<%= link_to "Add Friend",     new_user_friendship_path(friend_id: @user), class:    'btn' %>
</div>

<% if @statuses %>
<% @statuses.each do |status|%>
<div class = "well">
    <%= status.content %>
    <hr />
    <%= link_to    time_ago_in_words(status.created_at),    status_path(status) %> ago
    </div>
    <% end %>
<% end %> 

I am passing all tests - ruby -I test test/functional/user_friendships_controller_test.rb

Thanks

3 Answers

Check your routes. I had a similar problem. Check out [http://teamtreehouse.com/forum/ror-adding-state-accepting-friendships]. Hope this helps

Deleted User

Thanks Matthew...it worked!

Cheers!