Reputation: 354
I tried a lot to fix this issue but didn't get any success. Here package details https://classic.yarnpkg.com/en/package/jquery-maskmoney I am using
rails 6.0.3.1
ruby 2.6.2
I followed the below steps.
$ yarn add jquery-maskmoney
after this package added successfully into yarn.lock
and package.json
yarn.lock
package.json
Now require jquery-maskmoney
in application.js app/javascript/packs/application.js
require("jquery-maskmoney")
Getting below error
Can you please help me to fix this issue? If you need more information please let me know. Thank you so much in advance.
Upvotes: 0
Views: 233
Reputation: 354
I have implemented solution and it's working fine.
Please download maskMoney.js
from here maskMoney.js
Now follow the steps.
Add the above jquery-maskmoney.js
in the app/javascript/packs/modules/common/jquery-maskmoney.js
In app/javascript/packs/application.js
import
import './modules/common/jquery-maskmoney.js'
Now you use $('.maskmoney').maskMoney()
in all places.
Upvotes: 3