<%
content_for :title do 'Role List' end
%>
<h1>Listing roles</h1>

<h2>Showing <%= @total %> roles</h2>

<table class="records">
  <tr>
    <th>Name</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @roles.each do |role| %>
  <tr>
    <td><%= role.name %></td>
    <td class="action"><%= link_to 'Edit', edit_role_path(role) if can?(:update, 'roles') %></td>
    <td class="action"><%= link_to 'Destroy', role_path(role), method: :delete, data: { confirm: 'Are you sure?' } if can?(:delete, 'roles') %></td>
  </tr>
<% end %>
</table>

<%= render partial: 'pagination' %>

<br />

<%= link_to 'New role', new_role_path if can?(:create, 'roles') %>
