I have created one API for product details In this API I also need to attach similar products in response.
So for similar products scenario are like following 1) Pri
Yes you can perform this operation by using just simple order query as like following
`Product.where("product.category_id = ?", "category_id").order("abs(products.price - #{your_selected_product_price})")`