I’m the pesky guy that keeps posting questions aimed at understanding how to operate a web based business application that is able to serve (scope) many distinct users sharing a common monolithic database.
I’ve finally come up with a database schema that accomplishes this in .xml or .png, and am happy to share this.
Now, for my next question: Is there a way to call a Rails program from a Rails program?
I am effectively creating a ‘Quarterback’ Rails program that based on user input and selected ‘project’ loads the user into the desired application accessing a set of distinct ‘scoped’ data. Obviously, the Session will be a passed along to this application and when they’re finished they’ll return to the ‘calling’ Rails program.
I expect this is possible…has anyone ever done this? I’ve received responses saying to look at the System() method but that’s too ugly.
Thank you,
David
VirtualLifestyle@gmail.com
Well, the current popular way of having rails apps talk to each other is
to make them REST aware.
Rails 1.2 comes with a scaffold_resource generator that sets up the
controller for a domain object to be able to handle html requests or xml
REST requests. I don't mean to make REST sound simple though... there's
plenty o' learnin' to do there.
If your sessions are stored in the db, then you could probably pass the
session id along with the REST request, although I've heard that future
versions of rails will favor writing the entire session into the
cookie... so that may not work with this approach.
But really, I'd question whether there's some way you can get away from
needing to use the session on the helper apps... it would probably be
simpler for the main app to ask a helper app to do some work on it's
behalf without needing the session information at all.
Then again, if it's just "helper function" sort of stuff that the other
apps do for you, it might be better to look into backgrounddrb or a
message queue and make that side work asynchronous.
Hope this is helpful... and not just incoherent ramblings...