Create Your First API Using Rails 6 And Serve It To A Javascript API User | Week 4 Part 1 - 20in20

preview_player
Показать описание
In preparation for next week's 20 in 20 challenge React tutorial, this week I'm going to show you how to create your first API using Rails 6, and I'm also going to show you what it looks like to serve it to a Javascript API User.

The catch? You're that Javascript API user, because of course you are. We're going to create a very simple todo list application in Javascript, but we're going to store the data and get the data from a Ruby on Rails 6 API serving application using JSON.

Photo by Ferenc Almasi on Unsplash

Follow me on social media:

Join this channel to get access to perks:

#Deanin #Rails6 #20in20
Рекомендации по теме
Комментарии
Автор

Bit of a strange one this week. Originally I was planning on doing a React project, but I'm pushing it back to next week because I thought it might be fun to use an API for it, which means first we have to learn how APIs work! Also uh, thumbnails are gonna be done in a new style because I just learned how to cut myself out and I thought this was hilarious so we're gonna just keep that gag going until I get bored of it.

Hope this helps! Remember, you can follow me on Twitter & Instagram @deaniocom
And channel memberships are now available? So I guess I have to figure out what those are and how those work, even though I'm nowhere close to 30k subscribers lol.

Deanin
Автор

I'm not type of a person who does comments on YouTube videos, but hey, what you are doing here deserves a lot of compliments. I would like to thank you personally for all of the efforts you put into this. You rock Dean!

ErtugrulSEYHAN
Автор

this is the most useful content to start with rails APIs and build real stuff

ftmdgds
Автор

bro honestly your tutorials are the coolest, i was wondering how this is done and here is one of your videos again. awesome job brother and thank you !

anissmarrouch
Автор

ahh haa i was going to talk about api, hope we in future we do deployment of rails in docker and kubernate :)

DeepakKumar-jywo
Автор

Thank you for this tutorial! Simple and easy to start building APIs with Rails.

Just want to point out that I struggle to make the tasks list show on the HTML, and later found out that responses.length was <undefined>... I checked for a solution and supposedly, as responses is an object and not an array, it doesn't have that length property. I solved it using the following iteration to count the tasks, not much efficient but it works.

var lenght = 0;
{ length++; });

Please comment if there is another solution, or if any had the same issue.
Thank you!

martinyuvone
Автор

thanks for your videos they're so useful and easy to follow. Your voice sounds to me like
José Mourinho's voice.

daniscanada
Автор

Could you please make a tutorial with a realtime crud api using django ? Thatd be much appreciated

amanakeet
Автор

Hey boss, really interested in the automatic rubocop. Do you have a container running or a launch command to watch and amend as a daemon? I’d like to run it in a docker container mounting the codebase in a shared volume.

ehaughin
Автор

Neat video as always. What is the difference between xmlhttp request and fetch?

sassani
Автор

Hey Deanin, first thanks for the vid. What i was confused about is that u put the config of rack-cors into the config/application.rb, but there is an initializer for rack cors under config/initializers/cors.rb . Is there a reason you do it that way?

lucky
Автор

After I complete each step, make sure there is no typo and save it, when I run "responseText" in the console of chrome, only "Uncaught ReferenceError: responseText is not defined at <anonymous>:1:1" will appear, why? thanks

sanctum_saga
Автор

Great vid, will you be added auth to it?

RobertThomasrob_thomasa
Автор

I keep getting the following error message: No 'Access-Control-Allow-Origin' header is present on the requested resource.

How can I fix this?

lindenmeadow
Автор

tried this tutorial, am currently facing an error
I do understand this is regarding the cors gem, but have followed the same steps in the app.rb
0, Rack::Cors do
allow do
origins '*'
resource '*', headers: :any, methods: [:get, :post, :options]
end
end
still facing the above error, plz help me.

milop