background: image-url('dandelion.jpg');
background-position: center;
如上,这是一段 css 代码,里面有引用位于app/assets/images
的 jpg 图片,但是结果是这样的:
ActionController::RoutingError (No route matches [GET] "/images/dandelion.jpg"):
actionpack (4.2.7.1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
web-console (2.3.0) lib/web_console/middleware.rb:28:in `block in call'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `catch'
web-console (2.3.0) lib/web_console/middleware.rb:18:in `call'
actionpack (4.2.7.1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
我该如何才能让图片加载出来呢?用rake assets:precompile
似乎不行..