I am trying to use the JQuery Masked Input in my form on Rails 6. But it seems to me that the application.js in assets is not working, i am not sure. I installed the plugin through yarn with the command:
yarn add jquery-mask-plugin. It was included in package.json as a dependency.
//= require jquery //= require jquery_ujs //= require jquery-mask-plugin //= require_tree . $.jMaskGlobals.watchDataMask = true;
require("@rails/ujs").start() require("turbolinks").start() require("@rails/activestorage").start() require("channels") require("jquery") import 'inputmask';
Now in my form, this is how I tried to use the plugin:
<%= form.text_field :cpf, class:'form-control', 'data-mask': '999.999.999-99' %>
As I said before, I am not sure, but I think the problem is the application.js file in assets, cause I wrote a
console.log("test") command just to see if it is executing and nothing appeared at the web console when the server was running.
Can someone would help me?