Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Communication between Rails apps

I have built two rails apps that need to communicate and send files between each other. For example one rails app would send a request to view a table in the other apps' database. The other app would then render json of that table and send it back. I would also like one app to send a text file stored in its public directory to the other app's public directory.

I have never done anything like this so I don't even know where to begin. Any help would be appreciated. Thanks!

like image 647
user115188 Avatar asked Apr 23 '12 19:04

user115188


1 Answers

You requirement is common for almost all the web apps irrespective of rails, Communicating with each other is required by most modern web apps. But there is a small understanding that you need to get hold on,

Web sites should not directly access each others internal data (such as tables), (even if they are build by the same language (in this case Rails) by the same developer),

That is where the web-services comes in to play, So you should expose your data through web services so that not only rails application can consume that, but also any app that knows how to consume a web service will get benefit.

Coming back to your question with Rails, rails supports REST web services out of the box, So do some googling about web services, REST web services with rails

HTH

like image 115
sameera207 Avatar answered Oct 12 '22 08:10

sameera207