skr*_*lyk 3 assets ruby-on-rails image asset-pipeline
我将图像从公共/图像移动到资源/图像路径
我有图像:
<%= image_tag("login_logo.png", :id => "login_logo") %>
Run Code Online (Sandbox Code Playgroud)
我将它从公共文件夹移动到资产并更改了路径.
它是可见的并且工作正常,但我在控制台中出错:
Started GET "/assets/logo_PG.png" for 127.0.0.1 at 2012-10-10 23:42:53 +0300
Served asset /logo_PG.png - 304 Not Modified (0ms)
ActionController::RoutingError (No route matches [GET] "/images/login_logo.png")
Run Code Online (Sandbox Code Playgroud)
我怎么解决这个问题?
资产子目录中的所有内容(无论是图像,JS等)都默认可用/assets/name.extension
.因此,请确保/assets/login_logo.png
使用路径引用图像,或使用asset_path
帮助程序:
<%= asset_path('login_logo.png') %>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4949 次 |
最近记录: |