Rails: custom TLD support for multi-tenant app instance
<p>I've built a multi-tenant app with <code>apartment</code> gem. Every user of this app is assigned a unique subdomain e.g. <code>user1.myapp.com</code>. Now, I want to allow my app user to setup his own custom TLD e.g. <code>useroneapp.com</code> and this domain should work with all the routing which I've set in my app. I'll allow the user to save this domain through his dashboard in the database, but I'm not sure what other step(s) are required on my end to make this TLD work with that user's app instance.</p>

<p>My app is based on rails 4.2 and I might be hosting this app on heroku or digitalocean.</p>