Class: Spree::ProductsController

Inherits:
StoreController show all
Defined in:
app/controllers/spree/products_controller.rb

Instance Method Summary collapse

Methods inherited from StoreController

#cart_link, #unauthorized

Instance Method Details

#indexObject



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

def index
  @searcher = build_searcher(params.merge(include_images: true))
  @products = @searcher.retrieve_products
  @taxonomies = Spree::Taxonomy.includes(root: :children)
end

#showObject



18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/spree/products_controller.rb', line 18

def show
  @variants = @product.
    variants_including_master.
    display_includes.
    with_prices(current_pricing_options).
    includes([:option_values, :images])

  @product_properties = @product.product_properties.includes(:property)
  @taxon = Spree::Taxon.find(params[:taxon_id]) if params[:taxon_id]
end