From 0ade612b970e891b27fe0f7559b4c9308ef752cc Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 12 Dec 2017 16:06:04 +0630 Subject: [PATCH] change dashboard data --- app/views/home/dashboard.html.erb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/views/home/dashboard.html.erb b/app/views/home/dashboard.html.erb index d78789a5..b6f597ce 100755 --- a/app/views/home/dashboard.html.erb +++ b/app/views/home/dashboard.html.erb @@ -160,11 +160,8 @@ <%= t("views.right_panel.detail.card_sale") %> : - <% total_card = 0.0 %> - <% @sale_data.each do |data| %> - <% total_card = data["card"] %> - <% end %> - <%= total_card.to_f %> + <% total_card = @sale_data.select { |hash| hash["card"]!=nil }.first %> + <%= total_card["card"].to_f %> <% end %>