-
Notifications
You must be signed in to change notification settings - Fork 243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails Webpacker #190
Comments
@redhoodie Was wondering the same thing. I think this Medium article does a good job of explaining it: |
Is it me or since this is an engine this is not compatible with Webpacker? |
hello :)
(from a brand new rails app) // This file is automatically compiled by Webpack, along with any other files
// present in this directory. You're encouraged to place your actual application logic in
// a relevant structure within app/javascript and only use these pack files to reference
// that code so it'll be compiled.
import Rails from "@rails/ujs"
import Turbolinks from "turbolinks"
import * as ActiveStorage from "@rails/activestorage"
import "channels"
Rails.start()
Turbolinks.start()
ActiveStorage.start()
// add this line at the bottom! be sure to place any materialize.js api calls after this is loaded
<%= File.read(File.join(Gem.loaded_specs['materialize-sass'].full_gem_path, 'assets', 'javascripts', 'materialize.js')) %> Now we can use the materialize javascript api like in the documentation! document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems, {}); // M is now defined :)
}); resources: |
(This more a n00b question than an issue)
How do I use this with webpacker?
What is the equivalent of:
//= require materialize
Could you please update the Usage section in Readme.md?
The text was updated successfully, but these errors were encountered: