<h1>Listing groups</h1>

<table class="data">
  <tr>
    <th>Name</th>
    <th>Created</th>
    <th>Founder</th>
    <th>Options</th>
  </tr>

  <% for group in @groups %>
    <tr class="<%= cycle('even', 'odd') %>">
      <td><%= link_to (h group.name), group %></td>
      <td><%= h group.created_at.strftime("%d %B %y") %></td>
      <td><%= link_to (h group.founder.username), group.founder %></td>
      <td>
        <%= link_to 'Edit', edit_group_path(group) %>
        <%= link_to 'Destroy', group, :confirm => 'Are you sure?', :method => :delete %>
      </td>
    </tr>
  <% end %>
</table>

<br />

<%= link_to 'New group', new_group_path %>
