How to organize large Rails application

ruby-on-rails

I am working on a large(ERP level) Rails project. We have 150 tables and more than 150 models. It takes minutes to find a model. Should we add all models under the models folder or should we put them in different subfolders? Same thing goes for controllers and views.

Best Answer

I think you are running into the limitations of a single Rails application. Much like having too much code in one module, it sounds like you have too many modules in one application.

You should consider breaking it up into multiple applications using a service model, or you might also go the route of plugins or even better look at the new Engine framework.

This will benefit you multiple ways. It will force you to exercise good encapsulation and have good testable interface points between pieces.

Good Luck

Related Topic