My app is on domain: abc.com
, Now I have another domain: mydomain.com
. I can routes mydomain.com
to a controller in app. But how I can routes blog.mydomain.com
to a controller?
Asked
Active
Viewed 837 times
0

babie
- 1,219
- 1
- 10
- 13
-
1Possible duplicate of [How to map a subdomain to an existing controller action in localhost](https://stackoverflow.com/questions/38507770/how-to-map-a-subdomain-to-an-existing-controller-action-in-localhost) – Qwertie Nov 19 '17 at 12:50
-
Are you asking about how to setup the DNS entries or about how to write your `routes.rb`? What have you tried so far? – spickermann Nov 19 '17 at 13:47
-
@spickermann I want to know how to write in routes.rb. Thanks. – babie Nov 19 '17 at 14:40
1 Answers
0
I believe what you want is this
constraints subdomain: 'blog' do
end
Furthermore; you need to notify your hosts about this when testing locally(dev environment).

N. Maina
- 1
- 1