Regius
Regius

Reputation: 70

Integrating multiple apps in Rails

I am working on a project in Rails. It contains multiple sub-projects. They have a common login and the rest is separate for all. I want to integrate them all in the main project. The sub-projects are pretty big, so putting them all together will make it cumbersome to manage the code. Is there any way to integrate the sub-apps or gems in the main project?

Upvotes: 1

Views: 319

Answers (1)

NM Pennypacker
NM Pennypacker

Reputation: 6952

You might consider breaking your apps into engines. It's a great way to isolate functionality and make code modular. Here's a link to the Rails engine docs: http://guides.rubyonrails.org/engines.html

If you need examples of real-world uses of engines you might consider looking at the code for Spree: https://github.com/spree/spree

With Spree you can add custom functionality by installing or building extensions, which are effectively Rails engines.

If you want to reference local gems/engines, you can point to them in your Gemfile like this:

gem 'mygem', :path => '/path/to/gem'

But make sure that the individual gems within your project don't have a .git folder, or you might run into errors regarding sub-modules.

Upvotes: 3

Related Questions