def edit
@product = Product.edit
end
should be
def edit
@product = Product.find(params[:id])
end
simple explanation
The edit action (#method) is called when you call e.q localhost:3000/products/1/edit
the 1
is the id of your product which is passed to your controller and can be accessed by using params.
when the user hit edit . It is ussually send the data to update action
def update
@product = Product.find(params[:id])
@product.update(params[:product].permit(:title, :desc))
end
Ok i know i'm not explain it good enough. You really need to read this