Alex Terletskiy
Alex Terletskiy

Reputation: 172

Rails separate app or engine

I have an app and I would like to build an admin management system for it that would be using the same database and probably even models. I want to keep it separate from an app but because I want to use share models between the two, I'm debating wether to use an engine or build a separate app?

One reason I'm more inclined towards a separate app is because I can deploy it separately without affecting the main app.

Any suggestions, opinions or experience?

Thanks!

Upvotes: 3

Views: 727

Answers (2)

Pierre Pretorius
Pierre Pretorius

Reputation: 2909

I would place the shared models, migrations & code in an engine and use it in two applications: the admin app and the normal app. You might find these useful:

https://github.com/EPI-USE-Labs/activesupport-decorators

http://pivotallabs.com/leave-your-migrations-in-your-rails-engines/

Upvotes: 1

Oleg K.
Oleg K.

Reputation: 1549

I would definitely recommend engines. Spree E-commerce is a very good example of separating a single app into engines representing core, frontend and backend. And it is very clear and handy in support.

https://github.com/spree/spree

Upvotes: 2

Related Questions