在Rooku上使用heroku但不在本地开发环境中的相对路径

时间:2012-11-29 10:43:31

标签: html ruby-on-rails-3 heroku

我在公共目录下有一个名为foo的文件夹,domain/foo将我带到foo/index.html

我有public/foo/assets/css/custom.css,可以通过相对链接访问

href="./assets/css/custom.css" rel="stylesheet"

当应用程序在heroku上加载时,它会正常加载,并且视图源会将{CSS}文件的链接显示为http://example.com/foo/assets/css/custom.css

在本地开发环境中,运行rails server时(rails 3.2.8),未加载CSS,“view source”显示CSS文件的链接为http://example.com/assets/css/custom.css,即< strong>不包括 foo/

0 个答案:

没有答案