# How to move data from a javascript control to the controller

**URL:** <https://www.ruby-forum.com/t/how-to-move-data-from-a-javascript-control-to-the-controller/69596>\
**Category:** Rails\
**Created:** [September 22, 2006, 3:53am UTC](https://www.ruby-forum.com/t/how-to-move-data-from-a-javascript-control-to-the-controller/69596 "2006-09-22T03:53:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [September 22, 2006, 3:53am UTC](https://www.ruby-forum.com/t/how-to-move-data-from-a-javascript-control-to-the-controller/69596/1 "2006-09-22T03:53:49Z")

</div>

I am using a javascript grid control, because I need a competent control  
to  
make a good GUI. HTML

 just isn’t quite enough in this case.

I know how to address the cells of the grid control in javascript, but  
not how  
to move that data from the HTML page to the rails controller.

Can someone please direct me to a tutorial on how to submit this data  
from the  
browser javascript context to the controller on the server?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [September 22, 2006, 12:38pm UTC](https://www.ruby-forum.com/t/how-to-move-data-from-a-javascript-control-to-the-controller/69596/2 "2006-09-22T12:38:54Z")

</div>

On 9/22/06, David J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks in advance.

Does the javascript grid control just manipulate the contents of the  
DOM? If so, can you not just POST your revised data to the server  
(standard http post). Or if you needed more frequent data transfer  
you could probably have a javascript timer that uses AJAX to send the  
data to the server.

Chris

---

<div class="post-metadata">

**Author:** ![elegant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/3ab097/32.png) [@elegant](https://www.ruby-forum.com/u/elegant)\
**Post date:** [September 22, 2006, 2:07pm UTC](https://www.ruby-forum.com/t/how-to-move-data-from-a-javascript-control-to-the-controller/69596/3 "2006-09-22T14:07:05Z")

</div>

That was my first hope. No, the JS grid does not just maintain a

. If it did, then the scaffold generated \<% link-to ;action =\>'update' %\> would have worked out of the box.

I suspect that I will need to use some AJAX type programming techniques.  
I  
would certainly not object to getting my feet wet in that direction.

Thanks,  
David J.
