2 domains using the same host, but routed differently
i have 2 domains (a.com and b.com) using the same application. However, I would need them to point to different routes.
a.com should use the action: /home/a_index
b.com should use the action: /home/b_index
What is the right wa开发者_如何学编程y to handle this in rails?
This and this are both very useful articles describing one approach to running multiple domains from a single Rails application. Essentially the approach outlined in both articles allows you to route to different controllers for different domains using routing statements like the following:
map.connect '', :controller => 'blah', :action => 'blah', :conditions => {:domain => 'blah'}
This should allow you to achieve your goal.
精彩评论