hendolim/countonanon

View on GitHub
app/views/friendships/index.html.erb

Summary

Maintainability
Test Coverage
<p id="notice"><%= notice %></p>

<h1>Listing Friendships</h1>

<table>
  <thead>
    <tr>
      <th>User</th>
      <th>Friend</th>
      <th>Approved</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @friendships.each do |friendship| %>
      <tr>
        <td><%= friendship.user_id %></td>
        <td><%= friendship.friend_id %></td>
        <td><%= friendship.approved %></td>
        <td><%= link_to 'Show', friendship %></td>
        <td><%= link_to 'Edit', edit_friendship_path(friendship) %></td>
        <td><%= link_to 'Destroy', friendship, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Friendship', new_friendship_path %>