Does anyone know if its possible to use the old sprocket pipeline setup in Rails 6? I've read somewhere that it's possible to use it instead of the new webpacker pipeline, but i can't find the source where i've read that.
Thanks in advance everyone!
Greetings!
Well this is how i did it
rails new app-name --skip-webpack-install --skip-javascript
--skip-webpack-install
prevents the generator from running rails webpacker:install.
--skip-javascript
drops the webpacker gem from the Gemfile.
now in rails 6 app/assets/javascripts doesn't exists so you will have to create it yourself
Then, create app/assets/javascripts/application.js and add the following lines to it
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
Next, open app/assets/config/manifest.js and add the following line in the end
//= link_directory ../javascripts .js
Finally, open your application layout (app/views/layouts/application.html.erb) remove the javascript_pack_tag
and add the following line
<%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
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