Sha256: 5383ae3eb8f3e3a8e20b0ed6dd511338243912adcba37a05f174c82907ce35e3

Contents?: true

Size: 650 Bytes

Versions: 6

Compression:

Stored size: 650 Bytes

Contents

<h1>Listing roles</h1>

<table>
  <tr>
    <th>Name</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @roles.each do |role| %>
  <tr>
    <td><%= role.name %></td>
    <td><%= link_to 'Show', role %></td>
    <td><%= link_to_if(can?(:edit, Role), 'Edit', edit_role_path(role)) %></td>
    <td>
      <% if role.users.length > 0 %>
        <span title="Roles with associated users cannot be deleted">Delete</span>
      <% else %>
        <%= link_to_if(can?(:delete, Role), 'Destroy', role, :confirm => 'Are you sure?', :method => :delete) %></td>
      <% end %>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Role', new_role_path %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
devisable-0.2.1 lib/generators/devisable/templates/app/views/roles/index.erb
devisable-0.2.0 lib/generators/devisable/templates/app/views/roles/index.erb
devisable-0.1.3 lib/generators/devisable/templates/app/views/roles/index.erb
devisable-0.1.2 lib/generators/devisable/templates/app/views/roles/index.erb
devisable-0.1.1 lib/generators/devisable/templates/app/views/roles/index.erb
devisable-0.1.0 lib/generators/devisable/templates/app/views/roles/index.erb