From 9b28f476d95f3eb770ada8a97cb3485f9c8f1eb7 Mon Sep 17 00:00:00 2001 From: wayungi Date: Thu, 17 Nov 2022 23:12:27 +0300 Subject: [PATCH] UPDATE: food index view --- app/views/foods/index.html.erb | 52 +++++++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/app/views/foods/index.html.erb b/app/views/foods/index.html.erb index c028cee..3cda0ce 100644 --- a/app/views/foods/index.html.erb +++ b/app/views/foods/index.html.erb @@ -1,14 +1,38 @@ -

<%= notice %>

- -

Foods

- -
- <% @foods.each do |food| %> - <%= render food %> -

- <%= link_to "Show this food", food %> -

- <% end %> -
- -<%= link_to "New food", new_food_path %> +<%# + + %> +
+
+

List of Foods

+
+ <%= link_to 'Add Food', new_food_path %> +
+
+ + + + + + + + + + + <% @foods.each do |food| %> + + + + +
+
+ + + <% end %> + +
FoodMeasurement UnitPrice UnitAction
<%= food.name %><%= food.measurement_unit %><%= food.price %> + <%= link_to'Delete', food, :method => :delete %> +
+
+
+ <%# + %>