What is the best way to reuse a project in RoR?

dagosi89 Posted by dagosi89 on January 03, 2013

I have a "core" project developed in RoR. The problem is that there are several independent projects which have this "core" as they based code, and then they may have new functionalities or changes in views, helpers, controllers, etc. I want that any change in the "core" can be tracked by these other projects. Hence, any change in the "core" will be replicated, or not, on the other projects. I was thinking in gemify the "core" project, but due to the constant changes that the other projects have, this wouldn't be the best solution (is a long process too). That's what I think. Other solution would be to separate some important code into modules. Then I can import this new features in the projects which want to use them.

What do you suggest for this issue?

Thanks in advance.

Answers

fj2c Answered by fj2c on January 03, 2013

Engines seem the best option for this

psychocandy Answered by psychocandy on January 07, 2013

I agree with fj2c, I think this is a classic case of using Engines - http://guides.rubyonrails.org/engines.html It sounds like you'll need a full engine, but you'd might want to read about the differences between a mountable and a full engine on stackoverflow

piyush Answered by piyush on August 26, 2013

gem is not a right approach for this, better go with Engines .

Rails Engines : Official Page