From c30167e192c1ab7c258a43bd73628b6e9cfefebb Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Fri, 24 Oct 2014 11:04:28 -0400 Subject: [PATCH] List friends, but still not working --- app/controllers/friendships_controller.rb | 1 - app/views/friendships/index.html.erb | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/friendships_controller.rb b/app/controllers/friendships_controller.rb index 31f91da..50c12a6 100644 --- a/app/controllers/friendships_controller.rb +++ b/app/controllers/friendships_controller.rb @@ -3,7 +3,6 @@ class FriendshipsController < ApplicationController def index @friends = current_user.friends - @friendships = Friendship.all end def create diff --git a/app/views/friendships/index.html.erb b/app/views/friendships/index.html.erb index ddb29a2..fbc69aa 100644 --- a/app/views/friendships/index.html.erb +++ b/app/views/friendships/index.html.erb @@ -8,10 +8,11 @@ - <% @friends.each do |friendship| %> + <% @friends.each do |friend| %> - <%= friendship.name %> - <%= link_to 'Destroy', friendship, method: :delete, data: { confirm: 'Are you sure?' } %> + <%= friend.name %> + <%= link_to 'Destroy', friendship_path(friend), method: :delete, + data: { confirm: 'Are you sure?' } %> <% end %>