2013-04-08 55 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