NerdDiffer/job_tracker

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

Summary

Maintainability
Test Coverage
<% @page_title = 'Companies' %>

<h1>Search for companies</h1>

<p>
  <%= link_to new_company_path, class: 'add_new_member' do %>
    <i class='fa fa-plus'><span>New Company</span></i>
  <% end %>
</p>

<%= render 'search_filter' %>

<div id='companies'>
  <table class='table table-striped table-hover companies index'>
    <thead>
      <tr>
        <th><%= generate_sortable_link('companies.name', title: 'Name') %></th>
        <th>Website</th>
        <th>Categories</th>
      </tr>
    </thead>

    <tbody>
      <% @companies.each do |company| %>
        <tr>
          <td><%= link_to company.name, company %></td>
          <td>
            <%= link_to(
              company.website,
              interpolate_link(company.website),
              target: '_blank'
            ) %>
          </td>
          <td><%= display_names(company.category_names) %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>