简体   繁体   English

Rails 3.1 sub uri资产路径问题

[英]Rails 3.1 sub uri assets path issue

I am currently using rails 3.1.0.rc1 and when i deploy it to a server which is using passenger and it is deployed to a suburi.我目前正在使用 rails 3.1.0.rc1,当我将它部署到使用乘客的服务器时,它被部署到 suburi。

But when I go into look at the site, path to the style-sheets and java-script files are not being included because of the path.但是当我 go 进入该站点时,由于路径的原因,没有包含样式表和 java-script 文件的路径。

Can someone let me know how to specify the path in the environments so that all the assets (images, style-sheets and java-script ) point to the right path?有人可以让我知道如何在环境中指定路径,以便所有资产(图像、样式表和 java-script )都指向正确的路径吗?

This issue was fixed on Rails 3.1.0.rc4.此问题已在 Rails 3.1.0.rc4 上修复。 You no need to specify anything for the config.assets.prefix unless you want the change the default /assets.您无需为 config.assets.prefix 指定任何内容,除非您想更改默认的 /assets。

I got around it using YourApp::Application.config.assets.prefix = "/suburi/assets".我使用 YourApp::Application.config.assets.prefix = "/suburi/assets" 解决了这个问题。 Acording to issue #1489 , helpers didn't respect this till last Tuesday, so you'll have to use 3.1rc4.根据issue #1489 ,助手直到上周二才尊重这一点,所以你必须使用 3.1rc4。 Url's seem to get created correctly, so it may be more of a phusion problem. Url 的创建似乎是正确的,所以它可能更像是一个 phusion 问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM