<commit_before>
<head>
  <style type="text/css">
    .jumbotron.my-jumbotron {
      display: none;
    }
  </style>
</head>

<div id="sidebar-wrapper">
  <ul class="sidebar-nav">
      <li class="sidebar-brand">
          <a href="#">
              Start Bootstrap
          </a>
      </li>

      <h2 class="admin-sidebar-header">Management</h2>

      <li>
        <%= link_to "Add a category", new_category_path %>
      </li>

      <li>
        <%= link_to "Add a product", new_product_path %>
      </li>

      <h2 class="admin-sidebar-header">Categories</h2>

      <% @categories.each do |cat| %>
        <li><%= link_to cat.name, category_path(cat.id) %></li>
      <% end %>
      <li><%= link_to "other", other_path %></li>

  </ul>
</div>


<div class="container">
  <div class="jumbotron admin-jumbotron">

  </div>
  <div class="row">

      <% @products.each do |product| %>
        <div class="col-lg-10">
          <%= image_tag("money.jpg", width: '50', height: '50')%>
          <br>
          <span style="color: red; font-size: 20px">
          $<%= product.price %> - Stock: <%= product.stock %>
          </span>
          <h3> Name: <%= product.name%></h3>
          Description: <%= product.description %>
          <br>
          <div id="product<%=product.id%>" >
          <%= link_to 'Edit', edit_product_path(product)%> | <%= link_to "delete", product_path(product.id), method: :delete %>
          <br><br>
          </div>
        </div>
      <% end %>
  </div>
</div>
<div class="container">
  <h1 class="page-header">Administrator Dashboard</h1>
  <div class="table-responsive">
    <table class="table table-striped">
      <thead>
        <tr>
          <th>Product number</th>
          <th>Name</th>
          <th>Price</th>
          <th>Stock</th>
          <th>Description</th>
          <th>Edit</th>
          <th>Delete</th>
        </tr>
      </thead>
        <% @products.each_with_index do |product, index| %>
        <tbody>
          <tr>
            <td><%= index + 1 %></td>
            <td><%= product.name%></td>
            <td><%= product.price%></td>
            <td><%= product.stock%></td>
            <td><%= product.description%></td>
            <td><%= link_to 'Edit', ""%></td>
            <td><%= link_to "delete", "", method: :delete %></td>
          </tr>
        </tbody>
        <% end %>
    </table>
  </div>
</div>
<commit_msg>Fix admin page edit and delete<commit_after>
<head>
  <style type="text/css">
    .jumbotron.my-jumbotron {
      display: none;
    }
  </style>
</head>

<div id="sidebar-wrapper">
  <ul class="sidebar-nav">
      <li class="sidebar-brand">
          <a href="#">
              Start Bootstrap
          </a>
      </li>

      <h2 class="admin-sidebar-header">Management</h2>

      <li>
        <%= link_to "Add a category", new_category_path %>
      </li>

      <li>
        <%= link_to "Add a product", new_product_path %>
      </li>

      <h2 class="admin-sidebar-header">Categories</h2>

      <% @categories.each do |cat| %>
        <li><%= link_to cat.name, category_path(cat.id) %></li>
      <% end %>
      <li><%= link_to "other", other_path %></li>

  </ul>
</div>


<div class="container">
  <div class="jumbotron admin-jumbotron">

  </div>
  <div class="row">

      <% @products.each do |product| %>
        <div class="col-lg-10">
          <%= image_tag("money.jpg", width: '50', height: '50')%>
          <br>
          <span style="color: red; font-size: 20px">
          $<%= product.price %> - Stock: <%= product.stock %>
          </span>
          <h3> Name: <%= product.name%></h3>
          Description: <%= product.description %>
          <br>
          <div id="product<%=product.id%>" >
          <%= link_to 'Edit', edit_product_path(product)%> | <%= link_to "delete", product_path(product.id), method: :delete %>
          <br><br>
          </div>
        </div>
      <% end %>
  </div>
</div>
<div class="container">
  <h1 class="page-header">Administrator Dashboard</h1>
  <div class="table-responsive">
    <table class="table table-striped">
      <thead>
        <tr>
          <th>Product number</th>
          <th>Name</th>
          <th>Price</th>
          <th>Stock</th>
          <th>Description</th>
          <th>Edit</th>
          <th>Delete</th>
        </tr>
      </thead>
        <% @products.each_with_index do |product, index| %>
        <tbody>
          <tr>
            <td><%= index + 1 %></td>
            <td><%= product.name%></td>
            <td><%= product.price%></td>
            <td><%= product.stock%></td>
            <td><%= product.description%></td>
            <td><%= link_to 'Edit', product_path(product.id), method: :put %></td>
            <td><%= link_to "delete", product_path(product.id), method: :delete %></td>
          </tr>
        </tbody>
        <% end %>
    </table>
  </div>
</div>

{'fraction_non_alphanumeric': 0.20372645372645373, 'fraction_numerical': 0.006961506961506962, 'mean_word_length': 1.9164179104477612, 'pattern_counts': {'":': 0, '<': 225, '<?xml version=': 0, '>': 225, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3926084', 'n_tokens_mistral': 1770, 'n_tokens_neox': 1639, 'n_words': 331}