vegantech/sims

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

Summary

Maintainability
Test Coverage
<h1>Listing districts in <%=@state %></h1>
<p> The country admin will edit their own state.   If the state admin forgets their password you can reset it here.   If the state admin account is unusable you can recreate it here.   </p>
<table>
  <thead>
  <tr>
    <th>Name</th>
    <th>Abbrev</th>
  </tr>
  </thead>
  <tbody>
  <% for district in @districts %>
    <tr id="<%=h district.abbrev%>_tr" %>
    <td><%=h district.name %></td>
    <td><%=h district.abbrev %></td>
    <td><%= link_to 'Delete', district, :confirm => 'Are you sure?', :method => :delete %></td>
    <td><%= link_to 'Reset Admin Password', reset_password_district_url(district), :confirm => 'Are you sure?', :method => :put %></td>
    <td><%= link_to 'Recreate Admin', recreate_admin_district_url(district), :confirm => 'Are you sure?  You probably just need to reset the password instead.', :method => :put %></td>
   </tr>
</tbody>
<% end %>
</table>

<br />

<%= link_to 'New District', new_district_path %>