Commit 15fbdf8d by vulehuan

fix error when at product detail page

parent 628317a5
......@@ -8,7 +8,7 @@ class ProductsController < ApplicationController
def show
if Product.where(id: params[:id]).exists?
@product = Product.where(id: params[:id])
@product = Product.find_by(id: params[:id])
unless @product.status
user = current_user
if user.blank? || @product.user_id != user.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment