Skip to content

Commit

Permalink
UPDATE: food index view
Browse files Browse the repository at this point in the history
  • Loading branch information
wayungi committed Nov 17, 2022
1 parent 2481ed5 commit 9b28f47
Showing 1 changed file with 38 additions and 14 deletions.
52 changes: 38 additions & 14 deletions app/views/foods/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
<p style="color: green"><%= notice %></p>

<h1>Foods</h1>

<div id="foods">
<% @foods.each do |food| %>
<%= render food %>
<p>
<%= link_to "Show this food", food %>
</p>
<% end %>
</div>

<%= link_to "New food", new_food_path %>
<%# <!DOCTYPE!>
<html>
<body> %>
<section class="index-container">
<div>
<h2>List of Foods</h2>
<div class=" Add_button">
<%= link_to 'Add Food', new_food_path %>
</div>
<br>
<table class="table_food">
<thead>
<tr>
<th>Food</th>
<th>Measurement Unit</th>
<th>Price Unit</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<% @foods.each do |food| %>
<tr>
<td><%= food.name %></td>
<td><%= food.measurement_unit %></td>
<td><%= food.price %></td>
<div>
<td>
<%= link_to'Delete', food, :method => :delete %>
</td>
</tr>
</div>
<% end %>
</tbody>
</table>
</div>
</section>
<%# </body>
</html> %>

0 comments on commit 9b28f47

Please sign in to comment.