Ember.js, Rails and Subdomains of Wildcards

How can I use ember.js routing with rails lookup subdomains?

Let's say a user signs up on a site, gets a subdomain. Joe and Josh sign up, each of them gets a subdomain.

joe.mysite.com josh.mysite.com

Rails routes all my api calls (routes.rb), while ember routes everything else. What would be the best way to do this? Using rails or coal to route it? Can ember be used to route subdomains?

+4
source share
1 answer

The best way is to programmatically check with location.host or location.hostname .

But ember usually works with magic by faking URLs and not reloading the page ... I don't know how to switch subdomains without reloading the page.

I would redirect the subdomain to the URL in your main application and let Ember handle the routing from there.

0
source

Source: https://habr.com/ru/post/1497330/


All Articles