Class: Comable::ProductsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/comable/products_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#set_view_path

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/comable/products_controller.rb', line 5

def index
  @products = @products.includes(:images, :variants).page(params[:page]).per(Comable::Config.products_per_page)
end

#showObject



9
10
11
12
# File 'app/controllers/comable/products_controller.rb', line 9

def show
  products = Comable::Product.includes(:variants)
  @product = preview? ? products.find(params[:id]) : products.published.find(params[:id])
end