Dear Ruby-Community,

I m currently in the final days of an assignment where we're required to
program a linear optimization app.

However, right now I m desperately trying to create a table, where you
can enter a value anywhere (via best-in-place) in a certain coloumn and
it automatically gets transferred to all the other cells in this very
coloumn.

So imagine I enter a value in a coloum called "storage costs" once.
Since these storage costs are valid for all periods (period = my
indexes), I want them to be transferred automatically to all the
remaining storage cost cells. Here's what I tried... with an utter
failure.

<table id="product_bs" class="display" style="text-align: center">
  <thead>
  <tr>
    <th>Period</th>
    <th>Demand</th>
    <th>Opening inventory</th>
    <th>Storage cost</th>
    <th>Production coefficient labour</th>
    <th>Production coefficient machines</th>

  </tr>
  </thead>
  <tbody>

  <% @product_bs.each do |product_b| %>
      <tr>
        <td><%= best_in_place product_b, :id %></td>
        <td><%= best_in_place product_b, :demand %></td>
        <td><%= best_in_place product_b, :opening_inventory %></td>
  <% end %>
  <% @product_bs.first do |p| %>
      <td><%= best_in_place p, :storage_cost %></td>
      <td><%= best_in_place p, :production_coefficient_labour %></td>
      <td><%= best_in_place p, :production_coefficient_machines %></td>
      </tr>

  <% end %>
  </tbody>
</table>

<br />


Please Help!

-- 
Posted via http://www.ruby-forum.com/.