What's the easiest way to point a subdomain in Rails to a specific controller?
-
06-07-2019 - |
Question
For example, http://foo.myapp.com/bar/23 would render FooController#bar.
Solution
Check out the plugin subdomain_fu
OTHER TIPS
I have been using subdomain_fu for quite a while. Recently I discovered subdomain_routes that seems to be a really powerful alternative.
I am using subdomain_routes with complex routing and it appears to make the application very slow.
In Rails 3.2, one can route subdomains easily in the routes.rb file.
constraints :subdomain => 'foo' do
resources :bar
end
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow