From d4cfa7b3680abf59037a59aa3c1b326cdcfe7f55 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Mon, 21 Mar 2022 21:12:24 +0100 Subject: [PATCH] Add header to the table --- .../products_table_component.html.haml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/components/products_table_component/products_table_component.html.haml b/app/components/products_table_component/products_table_component.html.haml index 2b1b83b6da..3a0d5724bf 100644 --- a/app/components/products_table_component/products_table_component.html.haml +++ b/app/components/products_table_component/products_table_component.html.haml @@ -12,4 +12,12 @@ #products_table %table - = render(ProductComponent.with_collection(@products, columns: @columns_selected)) + %thead + %tr + %th + Name + - @columns_selected.each do |column| + %th + = @columns.find{ |c| c[:value] == column }[:label] + %tbody + = render(ProductComponent.with_collection(@products, columns: @columns_selected))