Fetch Requests and Controller Actions: Connecting the Frontend to the Backend
Let’s make fetch happen. Why do we need it? What can we do with it? How is it related to controller actions?
Table of Contents
- Introduction
- Refresher on Fetch Requests
- Structuring the Request with Fetch
3a. Bonus! Getting the user’s input from a form - Handling the Request & Structuring the Response with Controller Action
- Handling the Response with .then
- Conclusion & Summary
- Want more? Other resources to check out!
Introduction 💻
What does it mean to be a full-stack developer? Well, according to W3Schools, it means: “a person who can develop both client and server software”.
While I do agree with their definition, I would add that full-stack developers are basically match-makers 🥰. On their own, the frontend and backend are independent and don’t necessarily care about each other. Thus, it is the full-stack developer’s responsibility to make that connection happen and “match them up”. In other words, I believe that full-stack developers are people who know how to send…