On Jul 8, 5:57 pm, Ar Chron <li...@ruby-forum.com> wrote:

> Use the id field for all your rails coding
> - the product record and parent id of the child review records, and use
> the barcode value to access the external 3rd party API data.


Hi Ar,

That's pretty much how I'd originally structured it when I was using
all locally derived data - a products table and a reviews table, along
the lines of the posts / comments example in the Getting Started with
Rails Guide, with the barcode stored in the products table, in turn
used to look up item attributes from the API.

So: /products/<id>/reviews/<id> with <id> referencing the database id
field. All fine so far.

However, now I have a model-less  /products/<barcode> that can display
any item, for which all data is coming from the API, and for which
there's no product record, may or may not have reviews, ie. It's
possible to search for and display data for _any_ product that the API
has data for, with no local database involved, hence I don't have a
product_id field to code around.

That's where I'm struggling (and probably mostly because I'm coding by
example and haven't found a suitable example to borrow from).

Thanks,
Matt.

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to