Rails 6: How to add jquery-ui through webpacker?

后端 未结 8 974
失恋的感觉
失恋的感觉 2021-01-05 04:12

I\'m currently trying to implement a datepicker into my application, the problem is that there is no documentation on how to add the jquery-ui-rails gem through

8条回答
  •  无人及你
    2021-01-05 04:28

    $ yarn add webpack-jquery-ui
    

    and in application.js

    require('webpack-jquery-ui');
    require('webpack-jquery-ui/css');
    

    did the job for me. (I had setup jquery before which might need some additional config)

    Weblink: https://www.npmjs.com/package/webpack-jquery-ui

    (This is the same process as in Tushar Patil's answer yet with another package).

提交回复
热议问题