I would like to create a Ruby on Rails server that will listen to a port to accept data from interne

Hi,
I am building a server web application using Ruby on Rails 3 that will
listen to a port to receive data from a remote client. The data is gps
location which I will then post it on a map on the server web page.

I had read about Ruby language socket programming. But how to
implement this in rails? In the controller section?

I had search the internet but I can’t find a step by step guide to do
this. Hope some one can assist me on this or provide pointers to links
where by I can find the answer.

Thanks,
Kevin

On Mon, Feb 27, 2012 at 5:28 AM, New2RoR [email protected] wrote:

where by I can find the answer.

If I understand correctly, you will build 2 services:

  1. an API that will receive the GPS data (locations)
  2. a website (a GUI) that will show a map with the locations

Both are perfectly possible with Rails.

For (1) which API interface do you want to use. Does the remote
client that will talk to your server have a standard API format?

For (2) checkout the many existing solution for showing maps
(e.g. from Google) with your own data points on it.

You will typically not need direct “socket programming”. Rails
has default mechanisms for building an RESTful API.

HTH,

Peter