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

Deleting Friendship

seem to be getting a routing error when i delete a friendship.

Routing Error

No route matches [DELETE]                "/user_friendships/16/accept"
Try running rake routes for more information on                   available routes.

2 Answers

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hi Bernard,

It looks like you're deleting to the accept_user_friendship_path rather than just the user_friendship_path. Could that be it?

Deleted User

Thanks Jason, you are right!

      <%= form_for @user_friendship, url:    accept_user_friendship_path(@user_friendship),     method: :delete do |form| %>
        <%= submit_tag "Delete Friendship", class: 'btn   btn-danger' %>

should be

     <%= form_for @user_friendship, url:  u  ser_friendship_path(@user_friendship), method:    :delete do |form| %>
        <%= submit_tag "Delete Friendship", class: 'btn btn-danger' %>