List all products
This commit is contained in:
parent
9c1d505a10
commit
1b9b765240
1 changed files with 4 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue