ricarthlima/eo-project-es

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

Summary

Maintainability
Test Coverage
<%= content_for :nav do%>
  <%= render "layouts/navbar" %>
<% end %>

<h1>Componentes</h1>

<table class = "table table-striped">
  <thead>
    <tr>
      <th>ID</th>
      <th>Cod europeu</th>
      <th>Cod ins</th>
      <th>Nome</th>
      <th>Descricao</th>
      <th>Class vegan</th>
      <th>Justificativa</th>
      <th colspan="3"></th>
    </tr>
  </thead>

  <tbody>
    <% @componentes.each do |componente| %>
      <tr>
        <td><%= componente.id %></td>
        <td><%= componente.cod_europeu %></td>
        <td><%= componente.cod_INS %></td>
        <td><%= componente.nome %></td>
        <td><%= componente.descricao %></td>
        <td><%= componente.class_vegan %></td>
        <td><%= componente.justificativa %></td>
        <td><%= link_to 'Show', componente %></td>
        <td><%= link_to 'Edit', edit_componente_path(componente) %></td>
        <td><%= link_to 'Destroy', componente, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'Novo Componente', new_componente_path %>