2013-03-11 85 views
1

我遷移一個Rails 2.2.2項目到Rails 3,但我看到了很多404的錯誤:的Rails 2.2.2遷移到Rails 3 - CSS位置

Started GET "/assets/b2b.png" for 172.20.140.52 at 2013-03-11 12:30:24 -0400 
Served asset /b2b.png - 404 Not Found (8ms) 
ActionController::RoutingError (No route matches [GET] "/assets/b2b.png"): 

Started GET "/assets/default.css" for 172.20.140.52 at 2013-03-11 11:57:29 -0400 
Served asset /default.css - 404 Not Found (5ms) 
ActionController::RoutingError (No route matches [GET] "/assets/default.css"): 

在我的Rails 2.2.2項目,我所有的樣式表都存儲在 /var/www/my_app_directory/public/stylesheets/,所以我只是將其移至Rails 3,我認爲這是問題所在。

我應該在哪裏放置我的所有CSS for Rails 3才能開心?

感謝

回答

1

的Rails 3介紹assets pipeline所以你應該所有樣式表移動到

app/assets/stylesheets 

,並創建application.css它應該包含:

// require_self 
// require_tree . 
+0

大。感謝您的鏈接。按照您的指示解決問題。 – Slinky 2013-03-11 16:49:53