Recently I had a friend reach out to talk to me about APIs. It was unsurprising since they had spoken to me at the beginning of 2020 about changing into the tech sector by learning code at home. They asked great questions about languages and, unusually, they were interested in my enthusiastic explanations. You find that being into code and computers puts many into an uneasy disoriented haze while you talk about those subjects. But this friend was confused by Web APIs. What did they return? How did you use one?
In this article, I will discuss the answers to…
To start this you need Ruby and Rails installed. I used homebrew on a Mac, and that was fantastic. To start, let's create a new application:
rails new MyApp
cd into the project, pitter-patter, and lets that get at it!
Let's start with understanding a crucial part of Rails. It's a MVC, model view controller, framework. Which means any app built in Rails has that frame.
So, that means we will need models, controllers, and views for this tutorial. To generate those things all you need to remember is:
Take generating a model for our User:
Just a girl looking for snacks and writing code 🐼