Do I need jQuery-rails?
And if you want to use jQuery 3, you can require jquery3: For jQuery UI, we recommend the jquery-ui-rails gem, as it includes the jquery-ui css and allows easier customization. As of v3.0, jquery-rails no longer includes jQuery UI. Use the jquery-ui-rails gem above. jquery-rails is work of many contributors.
What is the default webpacker gem for Rails application generator?
Rails application generator installs Webpacker gem by default and also runs webpacker:install on its own. Active Storage, Action Cable, Turbolinks, and Rails-UJS is loaded by a new application.js pack in app/javascript by default and listed as dependencies in the default package.json
Should I use jQuery 2 or 3?
If you want to use jQuery 2, you can require jquery2 instead: And if you want to use jQuery 3, you can require jquery3: For jQuery UI, we recommend the jquery-ui-rails gem, as it includes the jquery-ui css and allows easier customization.
What are the best libraries to use with rails?
There are other JavaScript libraries or frameworks that can be used with Rails like Turbolinks, React, Vue, or Ember. At some point, your app might need one of these but today we’ll discuss jQuery. If you want to suggest a topic for a future blog post, please leave a comment below.