Topic: Can a Rails program call a 'Rails Program'?

In the Windows and DOS world I remember that we could call a program with a Shell() command, run that program for awhile, and then return to where it was called from in the original (calling) program.
I've read that Rails programs are invoked from the \ProgramNameFolder\Public\ProgramGoesHere. Can this program call another Rails program that resides in another \AnotherProgram\Public\OtherProgramGoesHere and can it return to where it was called in the first program?
Thank you,
David

Re: Can a Rails program call a 'Rails Program'?

You can execute any command within Rails (or Ruby in general) that would be valid on your system.  You do it with the system() method.

I have never heard of a Rails application attempting to call another rails application in this way though.  If both apps are running then it would be much easier to simply redirect to the other and have the browser of the user do all the work.  If you need to do some kind of computations then extract the code for it into a ruby library and include it in your app.

What kind of data are you trying to pass between apps?

Re: Can a Rails program call a 'Rails Program'?

Jack,
I visited your website and then your business that deals with developing and hosting RonR. Very impressive! Thanks for responding to my question.
My basic plan is to develop 'clusters' of websites. As a fictious example lets take a website for everyone that has birthdays in the month of March. There is a main website called www.MarchBirthdays.com but then also 30 others such as www.March_01_Birthday.com and so on.
My objective is to run 30 websites that use the same Ruby logic, but when a user accesses www.March_01_Birthday.com, they see a 'common RonR application' running, but the forums, wiki, Digg, articles, books, etc. gain their data from data elements in the database that are sub-tables of the (I call it project) highest level table. Now, If I haven't confused you too much here's how it plays out.
There is a main RonR program sitting in the www.MarchBirthdays.com/public folder that receives requests through the Apache VHost from user either the traditional request of "http:\\www.March_01_Birthday.com" or for those that are active in their particular website who've saved the link "Project\controller\action\keyvalue". This program is like a 'quarterback' as he reads the incoming requests, and calls the plays. The 'project' is an integer key that's part of a record that holds fields like 'program', 'program name', 'program location'. In the two types of http requests shown above, it deciphers the project integer and then calls the application program through the project_id. The project_id record then provides the logic of what program - database combo to call.
The long and short of this is that my "Hope" is to use a strategy like this INSTEAD of 30+ distinct domains, without having to write and install many (almost) identical (save for data) applications on a server.
Thank you,
David