[#409331] Capture HTML table data, pass to Ruby, pass back and display result in HTML text field — Hubert Wagner <lists@...>

Hello :

11 messages 2013/08/04

[#409336] Rakefile Error - Please Help — "Jennifer T." <lists@...>

Hi,

13 messages 2013/08/04
[#409341] Re: Rakefile Error - Please Help — Hassan Schroeder <hassan.schroeder@...> 2013/08/04

On Sun, Aug 4, 2013 at 7:41 AM, Jennifer T. <lists@ruby-forum.com> wrote:

Capture HTML table data, pass to Ruby, pass back and display result in HTML text field

From: Hubert Wagner <lists@...>
Date: 2013-08-04 12:55:49 UTC
List: ruby-talk #409331
Hello :
I need advice on how to proceed :

Given a table 6 x 30 rows. A typical row as follows :

Cell A (text) - Cell B (text) - Cell C (checkbox) - Cell D (number) -
Cell E (number) - Cell F (if C =3D true, D * E else O)

Cell F contains a Sub-Total for that row.
Cell F(n) contains the grand total - Sum of Cells F1 to Fn-1

The Ruby code does the following ;
1  If a checkbox is changed, calculate value of Cell F in the same row
and update the contents of the field.
However, Ruby would need to check constantly the status of each
checkbox. This sounds like a bad way to do this. Ideally, on change, the
checkbox would send a message to Ruby, but how?.

2  Update the value of Cell F(n)
(Cell F names could be numeric 1 to n-1 so Ruby could loop through and
sum the list)

I suppose the Sub-Total cells and the Grand Total cell would contain an
ERB : <% calculated value %>

However, I don=E2=80=99t see how the ERBs in Sub-Total/Grand Total could =
update
the table once the page has been rendered.

If item 1 above isn=E2=80=99t possible, the page could remain dormant unt=
il the
user clicks on a button to calculate the Grand Total.

I have the table. However, I don=E2=80=99t know where to begin with Ruby.=
 (I=E2=80=99m
doing this in RubyFrontier).

Regards : Hubert Wagner

-- =

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

In This Thread

Prev Next