Question

I'm trying to store two types of product identifications together, one for each product color for each product.

I want to do this without creating another table, just by storing a set of id pairs. My form looks like this:

enter image description here

How can i submit and store this data in a consistent way? Is Hstore a good alternative for this?

Was it helpful?

Solution

Why don’t you want to create another table? Your data model seems to necessitate it. I would recommend avoiding database-specific solutions when a Rails-based one (adding another model) would be more universal and is trivially supported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top