2013-04-08 50 views
0

我正在尝试使用SASS和指南针来创建图像精灵。不过,我也使用Backbone.js的,所以我的网址的样子:http://localhost/social/#/dashboard如何处理Backbone.js与SASS所需的“#”

所以,当我使用@include arrow-sprite($name);它给了我像一个网址:http://localhost/social/#/images/sidebar_buttons/arrow-sa2b2afd371.png

哪些Chrome检查员给了我这个错误:Resource interpreted as Image but transferred with MIME type text/html

如果我去,并从URL中删除“#”,图像加载正常。我config.rb样子:

http_path = "/social/" 
project_path = "C:/wamp/social" 
css_dir = "styles/css" 
sass_dir = "styles/sass" 
images_dir = "images" 
javascripts_dir = "js" 
+2

尝试启用相关的资产的config.rb:'relative_assets = TRUE' – cimmanon 2013-04-08 16:53:31

+0

或切换到绝对URL或者使用根目录中的路径。 – Loamhoof 2013-04-08 17:17:31

+0

@cimmanon添加你的答案,所以我可以给你信用! :) – thegreyspot 2013-04-09 13:21:26

回答

0

在config.rb启用相对资产:

relative_assets = true