diff --git a/app/controllers/friendships_controller.rb b/app/controllers/friendships_controller.rb index 4c79f15..31f91da 100644 --- a/app/controllers/friendships_controller.rb +++ b/app/controllers/friendships_controller.rb @@ -2,6 +2,7 @@ class FriendshipsController < ApplicationController before_action :require_login def index + @friends = current_user.friends @friendships = Friendship.all end diff --git a/app/views/friendships/index.html.erb b/app/views/friendships/index.html.erb index fa9cd4b..ddb29a2 100644 --- a/app/views/friendships/index.html.erb +++ b/app/views/friendships/index.html.erb @@ -8,8 +8,9 @@ - <% @friendships.each do |friendship| %> + <% @friends.each do |friendship| %> + <%= friendship.name %> <%= link_to 'Destroy', friendship, method: :delete, data: { confirm: 'Are you sure?' } %> <% end %>