Using Rails-UJS in JS modules (Rails 6 with webpacker)
in my app/javascript/packs/application.js: import Rails from ‘@rails/ujs’; Rails.start(); and then in whatever module, controller, component I’m writing: import Rails from ‘@rails/ujs’;
in my app/javascript/packs/application.js: import Rails from ‘@rails/ujs’; Rails.start(); and then in whatever module, controller, component I’m writing: import Rails from ‘@rails/ujs’;
It looks like there’s no application.css in your manifest.json which means you might not be importing any css from within your Webpack javascript files. If that’s all true, then you can fix the error in production by one of the following: Quick (temporary) fix: Add extract_css: false to your production block in config/webpacker.yml (which would … Read more
As simple as: <template> <div id=”app”> <img src=”./assets/logo.png”> </div> </template> <script> export default { } </script> <style lang=”css”> </style> Taken from the project generated by vue cli. If you want to use your image as a module, do not forget to bind data to your Vuejs component: <template> <div id=”app”> <img :src=”image”/> </div> </template> <script> … Read more