mongodb - How to create a multi-domain app in Rails 4 -
i want create multi-domain app rails , have been wondering best approach.
the app have set of functionality same functionality across domains, change in domain mean change in db used , styling (and content obviously) models , controller same.
the app use mongodb main storage (redis workers , other stuff not directly relevant model storage)
my idea is: once user signs up, new record created database created user id. user model store database id (recently created), , domain user have added. vhost file created , server reloaded.
once user visits app (using new domain). app check url , find correct db use based on url. saved variable used throughout app.
i imagine have check happen on each request.
i appreciate thoughts , comments on approach , best way achieve this.
Comments
Post a Comment