Get 2024 Templates Mega Bundle!14 Bootstrap, Vue & React Templates + 3 Vector Sets
Get for 99$

Rails: Implementing Toastr


Hello, I'm working with the fantastic Metronic 8 Rails starter app (v8.1.7), but I noticed Toastr isn't in settings.yml as a vendor.

I'm trying to implement it to use for Rails flash messages, but so far haven't been able to figure out how to get it implemented. Any advice? I used yarn/gulp for the build.

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  :(

Replies (2)


Nevermind. I found the answer in the Custom Bundles section of the docs. Just had to remove the "toastr" section from the "optional" section of the gulp.config.js file, then put this in the "custom" section of the same file:


toastr: {
src: {
styles: ["{$config.path.common_src}/plugins/toastr/build/toastr.css"],
scripts: ["{$config.path.common_src}/plugins/toastr/build/toastr.min.js"],
},
dist: {
scripts: "{$config.dist}/plugins/custom/toastr/toastr.bundle.js",
styles: "{$config.dist}/plugins/custom/toastr/toastr.bundle.css",
}
},


The run gulp again.

Finally added the following to the settings.yml file:

"toastr": {
"js": [
"custom/toastr/toastr.bundle.js"
],
"css": [
"custom/toastr/toastr.bundle.css"
]
}



Hi Ian Adams,

Glad you have solved it. We will add the instruction in the docs.

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  :(