Merge pull request #130 from ZeusWPI/order-api

List all products
This commit is contained in:
redfast00 2019-04-19 22:10:08 +02:00 committed by GitHub
commit 0d2a24fb41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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