Dear all,
there are two tables ,one is product, one is location, product has many location, and location belongs to product, all the setting in the models i have done, now in the views/show.html.erb, i want to display the product and its locations, usually we use @product.locations to get all the locations, acturally,it finds all the locations based on the id, but now, i have another column which is item_id in both tables and works as foreign key, so now i want to show the locations of the product where product.item_id=location.item_id , how to do this ?
Thanks