ralovely
ralovely

Reputation: 81

How to consolidate multiple rails application and share ressources

I have thi intranet I developped back then with PHP.

I handles multiple apps and tools (blog, link sharing, file sharing, events, clendar...), and a big user autenthication system for logging in and authorisation management.

I'd like to start re-building it with Rails.
I don't want to build one big app.
I'd like to build the site as multiple smaller apps, sharing a few common ressources like the user administration system, templates, layouts and navigation...

Rails Engine provide a way to embed an app into another.
I guess I could have a "main" app, embedding all other apps. But I don't feel it's the right way (I may be wrong) if I have 10-15 different apps.

How would you do it ?

Thanks.

Upvotes: 5

Views: 1190

Answers (3)

Erdem Gezer
Erdem Gezer

Reputation: 3272

You can share the models between projects adding

config.autoload_paths << Dir["SHARED_MODEL_PATH/app/models/*"]

to your application.rb config file.

Or you can check the tutorials about ActiveResource such as:

Upvotes: 0

Sarah Mei
Sarah Mei

Reputation: 18484

Check out ActiveResource - it is designed to allow you to use RESTful webservices as if they were ActiveRecord objects.

I'm working on a project now with a bunch of separate sub-apps that are pure web services (no UI). There's one "main" application that has all the UI and handles login/authentication, and then accesses the others via ActiveResource.

Upvotes: 1

Brian
Brian

Reputation: 4930

We've created applications that are split into 2 - the user facing site and an admin site. We just made 2 separate sites that have the same db and models and their own views and controllers.

This works pretty well and gives us the freedom to treat each site differently in terms of security and deployment.

I don't have any experience in going farther than that.

Upvotes: 1

Related Questions