在布局为false的视图中,我有下面的html代码。
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<link rel="manifest" href="manifest.json">Jquery正在加载,但没有加载manifest.json,当我查看页面源代码并查看它们时,会得到以下错误:
No route matches [GET] "/manifest.json"尽管我在资产文件夹中的javascripts文件夹中包含了manifest.json。
我也试过
<%= javascript_include_tag "manifest.json" %>但这不起作用,either..and得到了我试过的路由错误
<%= manifest_link_tag "manifest" %>这又一次失败了,给出了错误:
undefined method `manifest_link_tag' 我还在initializers/assets.rb中添加了manifest.json,但还是没有运气!!
发布于 2015-09-15 20:31:05
我想你应该把它像这一样包括进去
<link rel="manifest" href="<%= asset_path 'manifest.json' %>">发布于 2016-01-05 12:46:02
我的解决办法是:
= tag(:link, rel: 'manifest', href: some_path)或
= tag(:link, rel: 'manifest', href: asset_path('manifest.json'))https://stackoverflow.com/questions/32594929
复制相似问题