# Writing to a remote SQL Server w/javascript

**URL:** <https://www.ruby-forum.com/t/writing-to-a-remote-sql-server-w-javascript/170309>\
**Category:** Rails\
**Created:** [June 15, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/writing-to-a-remote-sql-server-w-javascript/170309 "2009-06-15T19:46:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![naevity](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e9a140/32.png) [@naevity](https://www.ruby-forum.com/u/naevity)\
**Post date:** [June 15, 2009, 7:46pm UTC](https://www.ruby-forum.com/t/writing-to-a-remote-sql-server-w-javascript/170309/1 "2009-06-15T19:46:11Z")

</div>

I’m working on a new project, and I’m having trouble wrapping my head  
around how I should structure this. I have a Ruby on Rails server that  
is hosting everything. I also have a few client machines, laptops and  
phones that will have a small app on them.

Every 5 seconds I need these apps to send a reading back to the  
server, which is going to store them it in a database in addition to a  
local copy.

I was looking at how I could do this using Javascript on the clients,  
and Rails on the server. Would the Rails ActiceWebService work? The  
client side is html/javascript ONLY, that’s stuck in stone, but I’m  
not worried about that, clientside I can do everything I need, it’s  
just the sending of the data to the rails server that I’m perplexed  
about.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![naevity](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e9a140/32.png) [@naevity](https://www.ruby-forum.com/u/naevity)\
**Post date:** [June 15, 2009, 7:55pm UTC](https://www.ruby-forum.com/t/writing-to-a-remote-sql-server-w-javascript/170309/2 "2009-06-15T19:55:05Z")

</div>

On Jun 15, 6:45 pm, naevity [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I was looking at how I could do this using Javascript on the clients,  
> and Rails on the server. Would the Rails ActiceWebService work? The  
> client side is html/javascript ONLY, that’s stuck in stone, but I’m  
> not worried about that, clientside I can do everything I need, it’s  
> just the sending of the data to the rails server that I’m perplexed  
> about.

Actionwebservice is for soap requests - not what you want here!  
Your client side Javascript can make http requests - read up on ajax.

Fred

---

<div class="post-metadata">

**Author:** ![naevity](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e9a140/32.png) [@naevity](https://www.ruby-forum.com/u/naevity)\
**Post date:** [June 15, 2009, 7:58pm UTC](https://www.ruby-forum.com/t/writing-to-a-remote-sql-server-w-javascript/170309/3 "2009-06-15T19:58:36Z")

</div>

Hi Fred,

Thank’s for the direction, I’ll give that a go.

On Jun 15, 1:54 pm, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
