1
0
Fork 0

Quick sample for listing friends

This commit is contained in:
Andrew Tomaka 2014-10-15 17:00:22 -04:00
parent 49368933cc
commit 32fccb4a8d
2 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@ class FriendshipsController < ApplicationController
before_action :require_login
def index
@friends = current_user.friends
@friendships = Friendship.all
end

View File

@ -8,8 +8,9 @@
</thead>
<tbody>
<% @friendships.each do |friendship| %>
<% @friends.each do |friendship| %>
<tr>
<td><%= friendship.name %></td>
<td><%= link_to 'Destroy', friendship, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>