Your AJAX request has a payload. The payload includes routing information, as well as instructions to the controller for which action to execute. Whichever action is executed either creates or does something with an existing instance of a model (a row in a table in your database server).
Once what's done has been done as your action is executed, Rails sends the result to a view. A view is either an HTML template or a JSON object (key-value pairs). This template/view takes in the model data. Voila! There's the unique info that's put on your webpage.
So the controller executes an action, then sends the result into the view. That view plus model data is the response that is sent back and which renders on your browser.
To do all that, you need to know HTML, CSS, JavaScript (the jQuery library has a built-in $.ajax() method--see the Examples at the bottom for the syntax of the payload object), Ruby (or another server-side scripting language), and Rails' Active Record or else SQL. And also the Command Line. The Command Line is what allows you to create (generate) a Rails project (file structure/directory).
So, HTML and CSS to control how your webpage looks, JavaScript to determine when and with what it will access your server, Ruby to write your server's logic which will determine how it accesses the database, some more HTML or JSON for your template/view, and...
- HTML
- CSS
- JavaScript
- Ruby
- Command Line
...that's all you need if you don't mind a bunch of page refreshes. But contemporary websites are increasingly using React, a JavaScript library, to get around that.