伙计们,我一直在关注 ruby 教程,在这一步中,我正在尝试向页面添加一些 CSS。
ActionController::RoutingError (No route matches [GET] "/assets/blueprint/print.css"):
我相信我的 routes.rb 文件搞砸了:
FirstApp::Application.routes.draw do
get "pages/home"
get "pages/contact"
get "pages/about"
root :to => "home#index"
application.html.erb 文件:
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<%= csrf_meta_tags %>
<%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
<%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>
</head>
<body>
<%= yield %>
</body>
</html>
服务器上的目录结构:
first_app% ls public
404.html 422.html 500.html downloads favicon.ico index.html.backup master.zip robots.txt stylesheets
[vasiliy@vbweb]~/ruby/first_app% ls public/stylesheets
blueprint
[vasiliy@vbweb]~/ruby/first_app% ls public/stylesheets/blueprint
ie.css plugins print.css screen.css src