camdub/Internships

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

Summary

Maintainability
Test Coverage
<h2>Departments</h2>
<div class="box round_all">
    <table class="display datatable index_tables">
          <thead>
              <tr>
                <th>Name</th>
                <th>College</th>
                <th colspan="3">Actions</th>
            </tr>
        </thead>
        <tbody>
            <% @departments.each do |department| %>
              <tr>
                <td><%= department.name %></td>
                <td><%= department.college.name %></td>
                <td>
                    <%= link_to department do %>
                        <button class="skin_colour round_all">
                            <img src="<%= icon_path %>/Document.png" alt="View this department" />
                        </button>
                    <% end %>
                </td>
                <td>
                    <%= link_to edit_department_path(department) do %>
                        <button class="skin_colour round_all">
                            <img src="<%= icon_path %>/Pencil.png" alt="Edit this department" />
                        </button>
                    <% end %>
                </td>
                <td>
                    <%= link_to department, :confirm => 'Are you sure?', :method => :delete do%>
                        <button class="skin_colour round_all">
                            <img alt="Delete this department" src="<%= icon_path %>/Trashcan.png" />
                        </button>
                    <% end %>
                </td>
            </tr>
            <% end %>
        </tbody>
    </table>
    
    <br />
    
    <%= link_to new_department_path do %>
        <button class="skin_colour round_all">
            <img src="<%= icon_path %>/Document.png" alt="New Department" />
            <span>New Department</span>
        </button>
    <% end %>
</div>