0

我有一个 Rails 应用程序

salmonfishing.com 

它有一个数据库。我有另一个应用程序

salmonfishing-test.com

如何为根 url 设置别名,以便当用户访问

http://salmonfishing-test.com

资产和数据来自

http://salmonfishing.com database 

将会被使用。

我的 database.yml 指向“salmonfishing”数据库,但生成的图像 url 是

http://salmonfishing-test/bigfish.png

这是预期的,但是在内部我希望它被别名为

http://salmonfishing.com/bigfish.png

...基本上所有资产和数据都来自“鲑鱼捕捞”数据库,并保存到其中。遇到各种设置子路径的方式,但不是资产和数据的根。

干杯,

 Jet
4

1 回答 1

0

如果您唯一的问题是资产 URL 中的域名错误,您可以在环境配置文件中更改它config/environments/[whatever].rb

config.action_controller.asset_host = "http://salmonfishing.com"

此行已存在于 中production.rb,但已被注释掉。

于 2012-06-06T21:03:46.163 回答