noesya/osuny

View on GitHub
app/views/admin/communication/websites/connections/_list.html.erb

Summary

Maintainability
Test Coverage
<div class="table-responsive">
  <table class="<%= table_classes %>">
    <thead>
      <tr>
        <th><%= Communication::Website::Connection.human_attribute_name('id') %></th>
        <th><%= Communication::Website::Connection.human_attribute_name('indirect_object') %></th>
        <th><%= Communication::Website::Connection.human_attribute_name('direct_source') %></th>
        <th><%= Communication::Website::Connection.human_attribute_name('updated_at') %></th>
      </tr>
    </thead>
    <tbody>
      <% connections.each do |connection| %>
        <tr>
          <td><%= link_to connection, [:admin, connection] %></td>
          <td>
            <%= render 'admin/communication/websites/connections/indirect_object', 
                        object: connection.indirect_object %><br>
            <span class="small">
              <%= connection.indirect_object_type %>
              <%= connection.indirect_object_id %>
            </span>
          </td>
          <td>
            <%= render 'admin/communication/websites/connections/direct_source', 
                        source: connection.direct_source,
                        type: connection.direct_source_type %><br>
            <span class="small">
              <%= connection.direct_source_type %>
              <%= connection.direct_source_id %>
            </span>
          </td>
          <td><%= l connection.updated_at %></td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>