Rails.ajax – Rails is not defined – Rails 7

I am trying to follow this tutorial to implement sortablejs:

https://www.youtube.com/watch?v=r884jAqAbHY

I’d like to persist the state by sending an ajax update to the server. The tutorial (Rails 6) does this via Rails.ajax

In Rails 7, this causes the console error:

Uncaught ReferenceError: Rails is not defined 

What is the “Rails way” of doing asynchronous requests in Rails 7?