List all products

This commit is contained in:
redfast00 2019-04-19 21:33:40 +02:00
parent 9c1d505a10
commit 1b9b765240
No known key found for this signature in database
GPG Key ID: 5946E0E34FD0553C
1 changed files with 4 additions and 2 deletions

View File

@ -48,8 +48,10 @@ class ProductsController < ApplicationController
def index
@products = Product.all
@categories = Product.categories
render 'products_list/listview' if current_user.admin?
respond_to do |format|
format.json { render json: @products }
format.html { render 'products_list/listview' if current_user.admin? }
end
end
def edit