我正在创建一个RoR-6应用程序,我从此行的application.html.erb文件中抛出以下错误:
javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
我收到以下错误:
ActionView::Template::Error: The asset "application.js" is not present in the asset pipeline.
该应用程序是通过运行rails new myapp -d postgres
创建的
我正在使用rails 6.0.0.rc1
您将要使用javascript_pack_tag
而不是javascript_include_tag
:
javascript_pack_tag 'application', 'data-turbolinks-track': 'reload'
这是必需的,因为webpacker在Rails 6中处理javascript编译。