Class: Stall::ProductsController

Inherits:
ApplicationController show all
Includes:
ProductsBreadcrumbs, ProductsSearch
Defined in:
app/controllers/stall/products_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
# File 'app/controllers/stall/products_controller.rb', line 6

def index
  search_products_among(Product.all)

  add_breadcrumb :products
end

#showObject



12
13
14
15
16
17
18
# File 'app/controllers/stall/products_controller.rb', line 12

def show
  @product = Product.friendly.includes(
    variants: [variant_property_values: [property_value: :property]]
  ).find(params[:id])

  add_product_breadcrumbs
end