Integrating multiple applications

I’ve got a couple apps that I use (billing app, support ticket app,
some other custom apps) that I want to integrate into one site. They
will all use the same layout for the most part, and will link between
each other.

When I initially thought of doing this, I figured if I put the apps at
different roots - /billing /support etc - then the links wouldn’t work
at all, because they’d have the app root prefix. Also I didn’t know
how to manage the layout. I ended up just creating one monster app,
because I needed to get it out quickly…but it really really sucks to
have it be a monolithic beast when it really is three separate apps.

Anyone know how I can integrate several apps into one site?

Pat

On Jun 19, 2006, at 9:39 PM, Pat M. wrote:

When I initially thought of doing this, I figured if I put the apps at
different roots - /billing /support etc - then the links wouldn’t work
at all, because they’d have the app root prefix.

Please elaborate. Are you familiar with the RAILS_RELATIVE_URL_ROOT
environment variable?


– Tom M.

On 6/20/06, Tom M. [email protected] wrote:

– Tom M.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

Sure, if I’m in the billing application, which has a
RAILS_RELATIVE_URL_ROOT of “billing”, then all of the links I generate
with the helpers will have that prefix. There’d be no way for me to
link to http://mysite/support/faq from inside a billing page.

Pat

On 6/20/06, Pat M. [email protected] wrote:

On 6/20/06, Tom M. [email protected] wrote:

On Jun 19, 2006, at 9:39 PM, Pat M. wrote:

When I initially thought of doing this, I figured if I put the apps at
different roots - /billing /support etc - then the links wouldn’t work
at all, because they’d have the app root prefix.

Correct me if I’m smoking something and not sharing…but I wouldn’t
the absolute URLs possibly work. Especially if you were to utilize a
hard-coded URL string in the routing:


As with url_for( ), link_to( ) and friends also support absolute URLs.
<%= link_to(“Help” , “http://my.site/help/index.html” ) %>


In theory, you should be able to exclude the “index.html” and create a
route with /help/… and route straight to the default help action.
Of course, yours would need to try using /support, etc… But I’m
thinking it would work. And if not I’ll be crying heehee… This is
the way I was planning on handling it in an upcoming app.

If not I may have to break it out and utilize a single-sign on
solution. :: grumble ::

-Curtis

On Jun 19, 2006, at 11:22 PM, Pat M. wrote:

environment variable?

Sure, if I’m in the billing application, which has a
RAILS_RELATIVE_URL_ROOT of “billing”, then all of the links I generate
with the helpers will have that prefix. There’d be no way for me to
link to http://mysite/support/faq from inside a billing page.

Ah, that sort of trouble. :slight_smile:

That said, you don’t have to use the link generators.

Rails apps can, indeed, link to non-rails apps written by developers
not so fortunate was we. :slight_smile:


– Tom M.

If you’re running *nix, you could just create symbolic links for your
layouts to each application: put the “real” file in one application,
then sym link it to all your other apps. That would allow you to
change your layout file in one place, and have the changes available
to all your applications simultaneously.

Much better than copy/paste, simple, easy to maintain, …

Regards

Dave M.

On 6/20/06, Tom M. [email protected] wrote:

That said, you don’t have to use the link generators.
http://lists.rubyonrails.org/mailman/listinfo/rails

Well these would all be Rails apps, which is why I’d prefer to use the
generators. I suppose I could just hardcode the links in, but that
feels ugly and un-railsy.

Also, how do I go about sharing layouts among all the different apps?
Do I have to resort to just copy and paste?

Pat

On 6/20/06, Curtis [email protected] wrote:

hard-coded URL string in the routing:
the way I was planning on handling it in an upcoming app.

Hey Curtis, check out this plugin I announced at
[PLUGIN] url_for_with_prefix - allowing you to modify/remove - Rails - Ruby-Forum. That will let you get around
the prefixes that get set. Also, if it’s actually possible to share
routes from plugins (it’s supposed to be, but people seem to be having
problems…), then you could use this in conjunction with shared
routes to achieve what you and I want.

Pat