2014-10-30 49 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

回答