All threads / DataTables Install via Webpacker

Ask A Question


You’re not receiving notifications from this thread.

DataTables Install via Webpacker

Dan Tappin asked in General

Hi, Dan. Still in trouble? I managed to get a demo app running data-tables e others jquery library here:

This demo is running Rails 6 with Webpack and Yarn.

According to the error that you describred at Datatables forum, looks like that you're missing to declare the jquery global variable '$'. Take a look to my environment configs (environment.js, app.js, etc) at the repo above.

Lucas, thank you! I must've tried 5 different things I found online. Your example was the only one that's worked.

Forgive me if I sound like an old man - but how the heck did this become so complicated when sprockets was so incredibly easy? How is webpacker an improvement here!?

I've literally tried like 7 different configs online and none of them work.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 53,130+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.