All threads / How do I have SubDomain and Multi-Tenant in Rails project.

Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I have SubDomain and Multi-Tenant in Rails project.

Gourav Lele asked in Rails

Can anyone please expain me How do I have sub-domains and Multi-tenant database for each sub domain in Rails Application.

For an Example:-
I am having Multi-Tenant database for year wise record of hotels, but my requiremnt :-
star.hotel.com => multi-tenant database
blue.hotel.com => multi-tenant database

Thank You

Check one more time :-
star.hotel.com =>
2011 // tenant1
2012// tenant2
2013// tenant3

blue.hotel.com =>
2011//tenant1
2012//tenant2
2013//tenant3

I covered how you can do this with the Apartment gem as well as from scratch in these episodes: https://gorails.com/series/multitenancy-crash-course

Thank you Chris I will try to do the same, but getting error on root page.
www.lvh.me:3000 is redirected if account is not present and its not working please assist me.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,629+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.