Harry Curotta
Joined
Activity
Most of the time websites do this so they can have a completely different application serve their landing pages vs their actual app. For instance you may want to have your landing pages be served by Wordpress, Squarespace or perhaps a static site generator like Jekyll.
Often this is done because separate teams do marketing vs product development, or because it isn't a good use of the product team's time to build and maintain a CMS in the same codebase as the application.
In this case you can just set your root DNS record to point to your website (e.g. wordpress), and another DNS record for app.domain.com to point to your rails app.
There's no need to follow this pattern in your routes if you're doing everything in your rails app just because you see other apps doing it.