I’ve a partial set up to bring in iTunes sales data I receive daily. I want to display on my product pages etc. My products all have a primary key but this is not present on the iTunes sales data table so I need to do my lookup using the UPC column as that the next best unique identifier. It’s probably very simple but how would I go about doing that?
<% render @product.itunes_datas %>
is referencing the following controller/method:
@itunes_datas = ItunesData.find (:all)
Do I just define another method in the controller?
I need this to be flexible if possible as product level lookups will be by UPC, whereas track level lookups will be via ISRC code.
Thanks in advance.
I’m not sure how you get the UPC information from Apple, but as long as you have it, you can perform lookups on it using whichever of these methods you like the most:
They’re exactly equivalent to each other and will find information based on the column you specify, rather than the primary key.