我把图片储存在 assets/image/下就认不到 储存在 public 下面就能认到 怎么解决 我用的是 rails 版本是 3.2.9
你需要去理解 Assert pipeline 得工作方式: http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets
@lgn21st For example, if you generate a ProjectsController, Rails will also add a new file at app/assets/javascripts/projects.js.coffee and another at app/assets/stylesheets/projects.css.scss. You should put any JavaScript or CSS unique to a controller inside their respective asset files, as these files can then be loaded just for these controllers with lines such as <%= javascript_include_tag params[:controller] %> or <%= stylesheet_link_tag params[:controller] %>. 谢谢你
#2 楼 @zhang991228752 我以为你会看到这个:
In regular views you can access images in the assets/images directory like this:
<%= image_tag "rails.png" %>
@woaigithub 并没有解决这个问题 css 能认到 而图片的地址没有认到 还是路由指向问题 他并不指向 assets/images/文件 而是 public 我图片并没有放到下面 而我并不能一张一张的设置图片地址