2014-10-30 45 views
0

我需要在一臺服務器上託管兩個Rails應用程序,並且我沒有太多域名。所以我跟着http://mattconnolly.wordpress.com/2010/09/19/redmine-ruby-on-rails-without-virtual-hosts/哪個有效。從http根URL變化:// {虛擬主機} /到http:// {主域}/railsapp/無虛擬主機的Rails應用程序

我的問題是,當我做這樣的事情:

redirect_to root_path 

我根據預期重定向到http:// {main-domain} /而不是http:// {main-domain}/railsapp /。我當然可以

redirect_to '/railsapp' 

但是有沒有更好的方式比重複/ rails應用程序遍佈應用程序?

+0

http://stackoverflow.com/questions/2660172/how-do-i-set-default-host-for-url-helpers-in-rails – Will 2014-10-30 09:23:26

回答