Right now I have some grave problems concerning the functionality of my linear optimization app which should be a breeze for programmers like you.
First of all, my seed.rb does not seed the data as desired. I have a simple table with 4 coloumns and 1 row. However, when I try to seed, ruby automatically generates two db entries instead of one. Moreover, it puts the values not in one row but places them diagonally in various rows.
So instead of getting a row like 1|1|1, I get:
1|-|-|
-|1|-|
-|-|1|
and instead of creating 4 entries, it creates 8. Same goes for creating one entry which generates 2.
Here's my seed.rb:
Period.create([{ period_nr: '1'}])
Capacity1.create([{ capacity_labour: '0'}, {capacity_machines: '0'}, {max_additional_personal_capacity: '0'}, {price_per_additional_capacity: '0'}])
Another issue I have is with automatically transferring values in a table. I have a table where I want that when you edit the value in one coloumn, all the other values in this very coloumn change accordingly.
example:
|0|0|0|
|0|0|0|
turns to:
|0|0|2|
|0|0|2|
when I enter 2 in the third coloumn first row, it should automatically get transferred to the third coloumn second row. Is there an easy way?
Please help me, this is for an essay which is due in just about a week. I m really desperate!