ricarthlima/eo-project-es

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

Summary

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

<p id="notice"><%= notice %></p>

<h1>Marcas</h1>

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

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

<br>

<%= link_to 'Adicionar Marca', new_marca_path %>