Why do this? As usual, we'll start with why. Why do this to our existing Ruby on Rails application? There are several reasons
We always keep our Ruby on Rails application up to date. Starting from Rails 5.1.0, rails-ujs is a part of the Rails itself.
We hate duplication. Why should we keep using jquery-rails (the gem for jquery-ujs) if Rails itself already has the rails-ujs with similar functionality?
We love to keep our Gemfile clean. We drop any gem that we don't use anymore. Jquery-rails is one of them.
Last but not least, we love to keep everything simple
Recommended requirement Before migrating from jquery-ujs to rails-ujs, we recommend the Ruby on Rails application has the following:
Integration tests. In our project, we use capybara and selenium, with some headless browsers.
Unit tests. We use RSpec for this.
Supported Rails version. At the time we did this, we've upgraded our Rails version to 6.0.2.1
Latest ruby version. We used 2.6.5 when we migrated long ago.
Make sure all the…
Score: 1.07
Privacy settings changed!
Article is saved. Do you want to continue editing the article or leave and edit later?