title: How to process requests for certain sub-domain(s) in Rails?
body: <p>For example, I want my project link to look like <code>http://blog.example.com</code>. How can I make that kind of route in Rails 4? And how it can interact with controller?</p>
  
  <p>The following stuff didn't work for me.</p>
  
  <pre><code>resource :article, constraints: {subdomain: 'blog'}
  </code></pre>