commit
0d2a24fb41
|
@ -48,8 +48,10 @@ class ProductsController < ApplicationController
|
||||||
def index
|
def index
|
||||||
@products = Product.all
|
@products = Product.all
|
||||||
@categories = Product.categories
|
@categories = Product.categories
|
||||||
|
respond_to do |format|
|
||||||
render 'products_list/listview' if current_user.admin?
|
format.json { render json: @products }
|
||||||
|
format.html { render 'products_list/listview' if current_user.admin? }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
|
Loading…
Reference in a new issue