I am creating a RoR-6 app and I get the following error thrown from application.html.erb file from this line:
javascript_include_tag 'application', 'data-turbolinks-track': 'reload'
I get the following error:
ActionView::Template::Error: The asset "application.js" is not present in the asset pipeline.
The app was created by running rails new myapp -d postgres
I am using rails 6.0.0.rc1
If you do not want to use Webpack, add the following to config/initializers/assets.rb
:
Rails.application.config.assets.precompile += %w(application.js)
You'll want to use javascript_pack_tag
instead of javascript_include_tag
:
javascript_pack_tag 'application', 'data-turbolinks-track': 'reload'
This is required because webpacker handles javascript compilation in Rails 6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With