Quick sample for listing friends
This commit is contained in:
parent
49368933cc
commit
32fccb4a8d
2 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,7 @@ class FriendshipsController < ApplicationController
|
|||
before_action :require_login
|
||||
|
||||
def index
|
||||
@friends = current_user.friends
|
||||
@friendships = Friendship.all
|
||||
end
|
||||
|
||||
|
|
|
@ -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 %>
|
||||
|
|
Loading…
Reference in a new issue