Forum: Ruby on Rails How do I serialize data for a controller action.

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Aeac27d9f81191536d3c86ee825d71b2?d=identicon&s=25 Don Mc (dmcclean)
on 2007-05-08 21:11
(Received via mailing list)
I have two instances of a intranet Rails application running on
different networks. The database design for each
is the same, but the data is different.

I occasionally need for certain database records to be copied from
application to another.
I would like to serialize the records and send the data to the 2nd
application's web server , where
a controller action would unserialize the records,  process them and
store in the 2nd database.

I am not sure how to do this. Any ideas?

Don Mc
7b74ccf93dde7dd2ac5d2980d14fdc7b?d=identicon&s=25 Paul Lynch (plynchnlm)
on 2007-05-08 23:22
(Received via mailing list)
It sounds like what you might be asking for is marshaling.  I haven't
tried it, but here's a reference:

8310c5a7c769345114597bcdef111488?d=identicon&s=25 Ben Munat (Guest)
on 2007-05-09 09:30
(Received via mailing list)
Or you could follow the hot trend in rails and just have them talk to
each other via REST.

There's support in the current version of rails for scaffolding
(generating) your models as "resources", which means you get basic
controller actions that return xml of your object if called as a REST

ActiveRecord will also do basic serialization to xml out of the box. If
your needs are fairly straightforward, this can be a very quick thing to

Oh, and there's also ActiveResource, a REST client library that allows
you to use the models from one app in another by making the REST calls
for you behind the scenes.

And finally, since it's been a hot topic, there's lots of information
out there about RESTful rails...

Aeac27d9f81191536d3c86ee825d71b2?d=identicon&s=25 Don Mc (dmcclean)
on 2007-05-09 16:15
(Received via mailing list)
Paul and Ben,
  Thanks for the help!
This topic is locked and can not be replied to.