lortza/sorrygirl

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

Summary

Maintainability
Test Coverage
<% content_for(:title, "Users Index") %>



<div class="container">
   
  
<h1>Users Index</h1>

<table class="table">
  <thead>
    <tr>
      <th>First name</th>
      <th>Last name</th>
      <th>Email</th>
      <th>Username</th>
      <th colspan="3">Manage</th>
    </tr>
  </thead>

  <tbody>
    <% @users.each do |user| %>
      <tr>
        <td><%= user.first_name %></td>
        <td><%= user.last_name %></td>
        <td><%= user.email %></td>
        <td><%= user.username %></td>
        <td><%= link_to 'Show', user %></td>
        <td><%= link_to 'Edit', edit_user_path(user) %></td>
        <td><%= link_to 'Delete', user, method: :delete, data: { confirm: "Are you sure you want to delete " + user.first_name + "'s account? This action cannot be undone." } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to ' New User', new_user_path, class: "btn btn-default btn-sm fa fa-plus" %>

</div> <!-- container -->