1
votes

I'm starting to learn to use React with Rails. In application.html.erb I replaced

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

with

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

How do I require everything from the /assets/javascripts/application.js file?

//= require rails-ujs
//= require activestorage
//= require turbolinks
//= require cookies_eu
//= require_tree .
//= require jquery3
//= require popper
//= require bootstrap

Do I import them all at the beginning of the /javascript/packs/application.js file?

1

1 Answers

-1
votes

Based on a tutorial I watched, I can just keep also the:

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

Then everything will be loaded, though not via Webpack.