0

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?

babie
  • 1,219
  • 1
  • 10
  • 13
  • 1
    Possible 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 Answers1

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