drapergeek/findit

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

Summary

Maintainability
Test Coverage
<%- model_class = Software.new.class -%>
<h1><%=t '.title', :default => model_class.model_name.human.pluralize %></h1>
<table class="table table-striped">
  <thead>
    <tr>
      <th>Name</th>
      <th>OS</th>
      <th>Licenses</th>
    </tr>
  </thead>
  <tbody>
    <% @softwares.each do |software| %>
      <tr>
        <td><%= link_to software.name, software_path(software) %></td>
        <td><%= software.operating_system_name %></td>
        <td><%= software.number_of_licenses %></td>
        <td>
          <%= link_to 'Edit',
                      edit_software_path(software), :class => 'btn btn-mini' %>
          <%= destroy_link(software) %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= link_to t('.new', :default => t("helpers.links.new")),
            new_software_path,
            :class => 'btn btn-primary' %>