I use ajax with lookup tables (some prefer dropdowns) to put them on the invoice line.
The number of models shouldn't matter.
Hello
Have situation, where products are in two/three different models due to differences in product and data, model example blow.
How to add products from two product models to orders, not sure if polymorphic relation can be used ? Please help with example codes (I can follow examples better).
Is this approach is correct? My understanding of polymorphic relation is limited, I was only able to follow the example of comment and image. Cannot model this based on those example, Please provide example code for model and controller.
toys
id - integer
name - string
gender_id - integer
category_id - integer
model - string
books
id - integer
title - string
genre_id - integer
author_id - integer
ISBN - string
cloths
id - integer
title - string
category_id - integer
gender_id - integer
size_id - integer
orders
id - integer
name - text
productable_id - integer
productable_type - string
Thank You
Please or to participate in this conversation.