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

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to