我正在将Rails 2.2.2项目迁移到Rails 3,但我看到了很多404错误:
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,我认为这是问题。
我应该把Rails 3的所有CSS放在哪里开心?
由于
答案 0 :(得分:1)
Rails 3引入了assets pipeline,因此您应该将所有样式表移到
app/assets/stylesheets
并创建应包含以下内容的application.css
:
// require_self
// require_tree .