Multiple applications using a single code base in ruby

北慕城南 提交于 2019-11-29 12:35:51

I think you've probably overcomplicated the situation somewhat. You can easily point different subdomains to different Rails applications using your web server configuration. For example in Nginx, you'd simply create different virtual hosts.

If you want all the modules contained in one application, then you can have a single virtual host with a wildcard subdomain, and use the routing in your Rails app to route via subdomain to different parts of your app. This would lend itself very well to an Engine architecture.

With regards databases, in the first example there's no problem at all as the different apps can handle their own database connections. With the engine example, typically engines tables would be in the same database but namespaced.

Edit - my answer is specifically talking about Rails, whereas your question was more generic.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!