Rails 3: On a local server (# rails server), my images weren't found, although the correct location is given
I started the rails server with rails server
.
My images are in public/images, i.e. the image public/images/rails.png is put into html with <img src="/images/rails.png" />
just as the image_tag
helper generates it.
But by any reason, the picture isn't found开发者_StackOverflow. If I enter the source of the file directly into the browser, I get a routing error: "No route matches http://0.0.0.0:3000/images/rails.png".
Any help?
Yours,
Joern
Check your environments' config file, ie. config/environments/production.rb
. If there's a setting config.serve_static_assets = false
, the problem you described will occur.
精彩评论