0

I am trying to build a multi-location app from a client. I have tried dabbling with Apartment and other types of multitenancy but didn't receive a proper result.

The app should have domains for each location as follows:

e.g. example.com/newyork, example.com/boston

I can't use subdomains, as they will be used for languages.

e.g. en.example.com/newyork, es.example.com/newyork

Each location will have a model showing content and search functionality for that location only.

e.g. When in newyork, boston posts won't be shown and when in boston, new york posts won't be shown.

However, a user has a single sign-on for all locations and languages, and a user can view all content posted within the app regardless of the location. If I use multitenancy, the user can only view New York posts when on /newyork and Boston posts when on /boston which is not the desired result.

What approach should I follow here? Does multitenancy even make sense?

af_dig
  • 1
  • 1

1 Answers1

0

Why you do mot want to add it to params? You will make url like www.mysite.com/en/boston or mysite.com/es/madrid

And you will make some default locale, where you'll load if no locale found in params.

As s simple example try out https://github.com/thoughtbot/high_voltage part about localization, it is very good example

Mike Belyakov
  • 1,355
  • 1
  • 13
  • 24