0
votes

I just upgraded my rails 4 app to rails 6. After installing webpacker gem and moving all js files from assets to app/javascript folder and compiling assets when i hit request on browser i got this error.

ActionView::Template::Error The asset "application.js" is not present in the asset pipeline.

Anyone can tell that what i am doing wrong?

1

1 Answers

0
votes

Use new view helper

<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>

in layouts/application.html.erb. Make sure your javascript folder structure should be like this.

  • app
    • javascript
      • images
      • packs
        • application.js
      • stylesheets