【发布时间】:2014-10-30 18:04:02
【问题描述】:
我需要在一台服务器上托管两个 Rails 应用程序,而且我没有那么多域名。所以我跟着http://mattconnolly.wordpress.com/2010/09/19/redmine-ruby-on-rails-without-virtual-hosts/ 工作。根 url 从 http://{virtual-host}/ 更改为 http://{main-domain}/railsapp/
我的问题是当我执行以下操作时:
redirect_to root_path
我被重定向到 http://{main-domain}/ 而不是 http://{main-domain}/railsapp/ 正如预期的那样。我当然可以
redirect_to '/railsapp'
但有没有比在整个应用程序中重复 /railsapp 更好的方法?
【问题讨论】: