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
|
before_action :require_login
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@friends = current_user.friends
|
||||||
@friendships = Friendship.all
|
@friendships = Friendship.all
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,9 @@
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
<% @friendships.each do |friendship| %>
|
<% @friends.each do |friendship| %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><%= friendship.name %></td>
|
||||||
<td><%= link_to 'Destroy', friendship, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
<td><%= link_to 'Destroy', friendship, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in a new issue