Hi,
So I've purchased the Good Template (Bootstrap 5). I'm trying to integrate this with my Rails 7 application. So far:
1. I have used the Layout Builder and created my layout and partials. I think I have done this part right and updated all the partial references to use the Rails "render" helper so they are all referenced correctly.
2. I have copied over all the css/sass by copying of the contents of the src/sass folder into my assets/stylesheets/theme and I have imported the _style.scss into my main application.scss.
Now I get a very ugly page but it seems that all my partials are loading atleast. I still need to import the media assets into my application, but what I'm confused about is the best way to integrate the javascript.
Ideally, I would want to use the Rails 7 conventions using importmaps, turbo, hotwire, and stimulus. But am I being too ambitious here? What would be the alternative method?
If I could get some high-level guidance on the best approach to integrate the javascript, I'd really appreciate it.
Also the third-party libraries like Datatables.js, should I use Importmap and pin them or is there another approach?
Hi Tariq,
The simplest approach is to use the bundled CSS files from the template's dist/assets folder and include them directly in your HTML head. This will quickly apply the template’s styles to your application.
However, you can directly work with the raw assets from the template's src folder if you prefer to follow Rails 7 conventions using Importmaps, Turbo, Hotwire, and Stimulus.
These 4 file bundles are required. You can refer to /tools/gulp.config.js for the list of included assets.
- style.bundle.css
- scripts.bundle.js
- plugins.bundle.css
- plugins.bundle.js
Let me know if you have any questions.
Thanks!