List friends, but still not working
This commit is contained in:
parent
32fccb4a8d
commit
c30167e192
2 changed files with 4 additions and 4 deletions
|
@ -3,7 +3,6 @@ class FriendshipsController < ApplicationController
|
|||
|
||||
def index
|
||||
@friends = current_user.friends
|
||||
@friendships = Friendship.all
|
||||
end
|
||||
|
||||
def create
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @friends.each do |friendship| %>
|
||||
<% @friends.each do |friend| %>
|
||||
<tr>
|
||||
<td><%= friendship.name %></td>
|
||||
<td><%= link_to 'Destroy', friendship, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= friend.name %></td>
|
||||
<td><%= link_to 'Destroy', friendship_path(friend), method: :delete,
|
||||
data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in a new issue