I upgraded the jQuery-rails gem version to version 3.1.2 (type: bundle show jquery-rails to see the current version of jquery-rails or gem list to see all the gems)
However, my webpage still used the deprecated version of jQuery 1.3. To check which version you are using, go to the jquery.js file, which is located in the assets / javascripts folder, the version should be indicated there. Of course, to use jquery, you must also include jquery.js in your /javascripts/application.js file by adding the following line:
//= require jquery
And in the event that you also have other JS libraries, for example, a prototype, you will definitely want to check this link as well: jQuery - preventing conflicts with other libraries
In any case, in accordance with the zzg recommendation above, I opened the link that he provided: Last Jquery and literally copied and pasted the contents of this web page into the jquery.js file. After I restarted the server and updated my web page, my jquery used the latest version. My jQuery worked locally on my dev env, but didn't immediately work on production (trying to figure it out right now).
Finally, another thing that may be useful for you to know is that you can always see which version the rails application uses (in your local env) by right-clicking on the rails application web page and selecting "View Page Source ", you should find a link like this:
<script data-turbolinks-track="false" src="/assets/jquery.js?body=1"></script >
By clicking on it, you will show the contents of your jquery.js file, which indicates the version (this will not work during production, since the resource pipeline compresses all javascript files into a single file, namely application.js)
Amitf source share