Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top