search for: item2_id

Displaying 2 results from an estimated 2 matches for "item2_id".

Did you mean: item1_id
2005 Dec 19
2
Difficulty using correct moldel for the data in DB
...ENT, `name` VARCHAR(255) , `cat_id` INTEGER(11), `rank` INTEGER , PRIMARY KEY(`id`) ); CREATE TABLE `cats` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255), PRIMARY KEY(`id`) ); CREATE TABLE `fusions` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `item1_id` INTEGER(11), `item2_id` INTEGER(11) , `product_id` INTEGER(11), PRIMARY KEY(`id`) ); Now... Creating one-to-many relationship for item/category is cake. How do I set up my model for item and fusion so I can have something like below in my view? <% for fusion in @item.fusions %> <%= fusion.item1.name %> +...
2005 Dec 18
0
Difficulty with creatating a model
...name` VARCHAR(255) , `cat_id` INTEGER(11), `rank` INTEGER , PRIMARY KEY(`id`) ); CREATE TABLE `cats` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255), PRIMARY KEY(`id`) ); CREATE TABLE `fusions` ( `id` INTEGER(11) NOT NULL AUTO_INCREMENT, `item1_id` INTEGER(11), `item2_id` INTEGER(11) , `product_id` INTEGER(11), PRIMARY KEY(`id`) ); Now... Creating one-to-many relationship for item/category is cake. How do I set up my model for item and fusion so I can have something like below in my view? <% for fusion in @item.fusions %> <%= fusion.item1.name %&gt...