I wrote this gist because I felt that the Rails documentation was lacking a description of ajax requests.
There are various ways to send ajax requests in Rails.
- Browser default Fetch API
Rails.ajax
(No Official docs and request for docs)- http client like axios
- @rails/request.js 👈 I'm using this one now !