Stimulus and Ajax
Learn to use Stilumus and Ajax in this lesson.
We'll cover the following...
Usually, when we talk about communication between the client and server, we are referring to the client calling the server to receive data. Let’s look at how we would make those calls in our Stimulus code.
Making Ajax calls
The simplest mechanism for making Ajax calls in modern JavaScript is with the fetch
function and the async
/await
syntax for handling asynchronous behavior.
The Rails UJS library provides an
ajax
method, but the ...