0

I have 2 Rails applications mounting a Core Engine. The Engine is used here to group common code between Rails applications (they have very similar business logic but views and some other things differ).

The Core::Engine holds:

  • common models
  • common controllers and actions
  • common libs
  • common routes

Rails applications holds:

  • specific models
  • specific controllers or existing controller actions
  • specific libs
  • specific routes

Since I own the Core Engine and the Rails applications, I was wondering about the benefits of using isolate_namespace Core.

Namespacing the Engine will avoid name collision but since my Engine is not meant to be mounted elsewhere, should I care ?

Moreover, namespacing is great but do not play well with routes since I would have to add core or main_app to every url helpers.

Question: Should I care about Engine namespacing in the case where the Engine is designed to DRY up common Rails application codebase ?

Pierre-Louis Gottfrois
  • 17,561
  • 8
  • 47
  • 71
  • Hi Pierre-Louis, i'm playing with engine for one of my apps and i'm asking the same question. Have you found something since you asked this question? – coding addicted Nov 22 '13 at 13:17
  • Hey, I actually went without namespace and it makes life easier for this particular case. However, for another project I only used the engine to hold shared models. I decided to namespace the engine to avoid class name collision but did not care about namespaced routes in this case. – Pierre-Louis Gottfrois Nov 22 '13 at 14:43

0 Answers0