You can develop multi tenant application very easily with Ruby on Rails
This article describe how you can use the tenant_id in different ways when you build the multi-tenant application
You can use the gem called apartment
Multitenancy Crash Course:
Multitenancy with the Apartment gem
If you would like to learn more about Multi Tenancy Architecture you can visit this tutorial
Three Database Architectures for a Multi-Tenant Rails-Based SaaS App