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? Regards, Don Mc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Paul E. G. Lynch
2007-May-08 21:15 UTC
Re: How do I serialize data for a controller action.
It sounds like what you might be asking for is marshaling. I haven''t tried it, but here''s a reference: http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_m_marshal.html#Marshal.dump --Paul On May 8, 3:05 pm, "Don.Mc" <Don.McCl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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? > > Regards, > Don Mc--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 call. 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 code. 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... b Paul E. G. Lynch wrote:> It sounds like what you might be asking for is marshaling. I haven''t > tried it, but here''s a reference: > http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_m_marshal.html#Marshal.dump > > --Paul > > On May 8, 3:05 pm, "Don.Mc" <Don.McCl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> 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? >> >> Regards, >> Don Mc > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Paul and Ben, Thanks for the help! On May 9, 2:29 am, Ben Munat <bmu...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 call. > > 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 > code. > > 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... > > b > > Paul E. G. Lynch wrote: > > > It sounds like what you might be asking for is marshaling. I haven''t > > tried it, but here''s a reference: > > http://www.ruby-doc.org/docs/ProgrammingRuby/html/ref_m_marshal.html#... > > > --Paul > > > On May 8, 3:05 pm, "Don.Mc" <Don.McCl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> 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? > > >> Regards, > >> Don Mc--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---