I'm trying to integrate Metronic 8.2.7 into my Rails project. CSS part was very easy. However, Javascript part is a pain in the ass. I have been dealing with this a lot of hours without success. Metronic is heavy dependent on Javascript. Basically, the issue is with the scripts.bundle.js, because KTApp init function is never instantiated.
// Init components
var KTComponents = function () {
// Public methods
return {
init: function () {
KTApp.init(); -> here it's the error (Uncaught TypeError: Cannot read properties of undefined (reading 'init')
KTDrawer.init();
KTMenu.init();
KTScroll.init();
KTSticky.init();
KTSwapper.init();
KTToggle.init();
KTScrolltop.init();
KTDialer.init();
KTImageInput.init();
KTPasswordMeter.init();
}
}
}();
Any way to make this Metronic HTML version work in my Rails 7 app?
Hi Gustavo,
Glad to hear! If you need any further assistance or have any questions as you continue, feel free to reach out.
Hi Gustavo Toro
Sorry for the delay. Regarding the scripts.bundle.js file, did you obtain it from the Metronic HTML dist/assets directory? Also, from the Metronic HTML tools folder, which builds tool are you using—Gulp or Webpack?
Can you try with gulp build?
Thank you
Hi Faizal,
I read part of the documentation and found the Rails project (I was using the HTML version) and now I have fully integrated the dashboard I need. Thanks.