DEV Community

Discussion on: Rails 7, Bootstrap 5 and importmaps without nodejs

Collapse
 
jmschp profile image
Miguel Hargreaves Pimenta • Edited

Hey!

I think this could be made simpler.
I believe the bootstrap-rubygem already injects in the assets throughs sprockets the bootstrap.min.js and SCSS files, and also the poper.js through the dependency popper_js-rubygem.

So, in terms of the JS files, all we need to do, after bundeling the bootstrap-rubygem, is import them in the application.js

import "./popper";
import "./bootstrap.min";
Enter fullscreen mode Exit fullscreen mode

I have this working in development.

Collapse
 
jusko profile image
jusko

Thanks. This is simpler.