Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

Good Template with Rails 7


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?


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


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!


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(