From c5d3922d364605979c9590f557fe032cc4d6bbc0 Mon Sep 17 00:00:00 2001 From: Jan Edrozo Date: Thu, 26 Oct 2017 22:26:45 -0700 Subject: [PATCH] Updated home method in StaticPagesController to only feature products instock (not Product.all) --- app/controllers/static_pages_controller.rb | 2 +- app/views/static_pages/home.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/static_pages_controller.rb b/app/controllers/static_pages_controller.rb index 043f2f66ba..08f08a41c3 100644 --- a/app/controllers/static_pages_controller.rb +++ b/app/controllers/static_pages_controller.rb @@ -1,5 +1,5 @@ class StaticPagesController < ApplicationController def home - @showcase = Product.all.sample(3) + @showcase = Product.find_instock.sample(3) end end diff --git a/app/views/static_pages/home.html.erb b/app/views/static_pages/home.html.erb index 3fb7cf33ad..6a3fa6baeb 100644 --- a/app/views/static_pages/home.html.erb +++ b/app/views/static_pages/home.html.erb @@ -1,4 +1,4 @@ -

Featured :

+

Featured Products:

<% @showcase.each do |item| %>