Simple Ruby on Rails 5 REST API From Scratch

Ғылым және технология

In this video I will show you how to create a very simple REST API from scratch using Ruby on Rails 5. We will be able to make requests to perform CRUD on articles stored in a MySQL database. We will install the mysql2 gem along with the faker gem to randomly generate content.
CODE: Code for this video
github.com/bradtraversy/simpl...
SUPPORT: We spend massive amounts of time creating these free videos, please donate to show your support:
www.paypal.me/traversymedia
/ traversymedia
FOLLOW TRAVERSY MEDIA:
/ traversymedia
/ traversymedia
/ traversymedia
MY EDUONIX COURSES: Please use affiliate links from website below
www.traversymedia.com/eduonix-...

Пікірлер: 228

  • @jarredmacquoid7688
    @jarredmacquoid7688 Жыл бұрын

    It's a joy to see that people are still learning rails. Beautiful framework for beautiful language!

  • @333ANON

    @333ANON

    10 ай бұрын

    It's a relic of the past. A good one, but still a relic.

  • @udyatbhanubaliyarsingh1090
    @udyatbhanubaliyarsingh10906 жыл бұрын

    You are an absolute blessing, I was going thru your Laravel tutorial on Udemy and then I was thinking of a scenario and wanted to know how to expose a REST api thru rails, I googled and then heard a familiar voice and there you are again lol. Thank you for doing what you do, and I took your Bootstrap 4 course as well which significantly made me better at UI.

  • @Templars1005
    @Templars10057 жыл бұрын

    Fantastic video man! Thank you very much. Your channel has been and continues to be extremely helpful. Keep up the great work!

  • @chainer22
    @chainer226 жыл бұрын

    You managed to cover what took my instructor almost 4 hours to cover in 1 hour. and it is so clear and easy to follow. thank you so much for making this.

  • @sirajussalekin9239
    @sirajussalekin92397 жыл бұрын

    Thank you so much. Rails 5 is amazing, I'm so grateful for your tutorial.

  • @websebdev
    @websebdev7 жыл бұрын

    I'm so glad that you made this video! I thought that you gave up on Rails. Thanks for your great videos :)

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    Nope, I have not given up on anything :) Well may be Flash lol. I want to have resources for all languages/frameworks. Rails is just a little more time consuming in my experience. I still plan on doing a shopping cart at some point

  • @luissantiago7978

    @luissantiago7978

    6 жыл бұрын

    Traversy Media with spree or from scratch?

  • @buttered_numbat
    @buttered_numbat5 жыл бұрын

    I have been watching your videos for like a year and you inspired me to learn to program. I'm a rails developer now and I literally never know what the hell you looked like. Hahaha, thanks so much for being awesome. Keep up the good work. You have become my after work podcast on my way home. :)

  • @ryanmontgomery6248
    @ryanmontgomery62486 жыл бұрын

    I like your style Brad. Thanks for this tutorial it was very well done and easy to understand. I really like the pace and explanation on your tutorials. Thanks

  • @israeluribe2010
    @israeluribe20105 жыл бұрын

    Great video, Brad! After this, now learning how to add authentication to the API using Devise and JWT. Wouldn't advance without this video! Thanks a lot!

  • @BIERKOFF07
    @BIERKOFF072 жыл бұрын

    Exactly what I needed. Great video... 4 years later and is very useful yet.... thanks

  • @clementhung5576
    @clementhung55763 жыл бұрын

    For anyone using rails 6, the update_attributes function is deprecated. It is simply article.update(article_params). Great Video either way but wished there was some installation guide, as a beginner it took me a long time trying to gem install mysql2.

  • @zanaeira

    @zanaeira

    3 жыл бұрын

    Thanks for this! I had the same issue on Mac. I had to install MySQL first using homebrew before it would work. In any case, this was a great tutorial so thanks for taking the time to make it :)

  • @philschmidt2104
    @philschmidt21044 жыл бұрын

    Thanks so much for making this tutorial - I'm still a student now but I'll make sure to show my support once I have a full time job - many thanks again!

  • @ThePolaris87
    @ThePolaris875 жыл бұрын

    Great simple tutorial. Thanks! And it's so awesome to be running Rails on Windows now finally!!!

  • @crazy_vulcan
    @crazy_vulcan7 жыл бұрын

    Love starting up youtube and seeing new great content. Keep up the great work.

  • @curlykink08
    @curlykink084 жыл бұрын

    Great tutorial, easy to follow and well explained. Thank you!!

  • @maxarellano3425
    @maxarellano34253 жыл бұрын

    Great video man. Much better than all the other tutorials on rails APIs

  • @luminarycrush
    @luminarycrush2 жыл бұрын

    Great starting tutorial, it got me going in the right direction. I did hit a wall attempting to connect to a pre-existing database and not a newly created one. RoR has this funny opinion about lower case table names and pluralizing things by default so that took me a while to figure out. But now I'm off to the races. Thanks!

  • @luissantiago7978
    @luissantiago79787 жыл бұрын

    Definitely donating for great content! Thank you for uploading a ror project again!

  • @doloresdadd
    @doloresdadd7 жыл бұрын

    Another great tutorial. You take the great factor of of learning a new language.

  • @d0m2288
    @d0m22885 жыл бұрын

    Your videos are always helpful, thank you.

  • @dave76920
    @dave769205 жыл бұрын

    So simple. So clear. So good. Thank you so much.

  • @bil4103
    @bil41035 жыл бұрын

    Recommended Ruby on Rails REST-API tutorial 👍🏻

  • @yiranli145
    @yiranli1456 жыл бұрын

    Thank you so much! This video is really helpful and clear for a beginner like me!!

  • 4 жыл бұрын

    I followed tonight this tutorial without any problems. I have already used Postman before but with you explaining it looks like easier. Nowadays the Postman Extension is deprecated as Google Web Store shows in its page and they suggest us to use Postman Native Apps, but even this way it worked perfectly here. Thanks again for sharing your experience with us, Brad. :)

  • @andreivandrummer
    @andreivandrummer7 жыл бұрын

    I bought your course by building 12 applications with Angular 2 and it's amazing, and all the videos you've done on youtube have been the same, I've learned too much! THANK YOU! I'll wait for the authentication token! (Part 2 of this video haha) thanks! : P

  • @emrahakgul8296
    @emrahakgul82965 жыл бұрын

    Great work requires great appreciation. Thanks for great video, man.

  • @guilhermebertholuiz1560
    @guilhermebertholuiz15603 жыл бұрын

    I cant thank you enough, with this video I know exactly what I have to do for a test

  • @MaHa63b
    @MaHa63b4 жыл бұрын

    Very clear presentation about Ruby on Rails API functionality. Thank you about contribution.

  • @matthewhanyu6158
    @matthewhanyu61586 жыл бұрын

    Awesome tutorial! I got a lot of things...thank you!

  • @ChronosLordTime
    @ChronosLordTime5 жыл бұрын

    Awesome video, good edition, well explained, straight to the point.

  • @kwesiacquah-dadzie1431
    @kwesiacquah-dadzie14314 жыл бұрын

    Brilliant tutorial! Well explained. Thank you

  • @MarkCorrea
    @MarkCorrea5 жыл бұрын

    Awesome. Simple and easy to understand.

  • @danatassler8776
    @danatassler8776 Жыл бұрын

    Been out of Rails development for a few years now. I've not looked back because I DETEST full-stack development. By that, I mean I really dislike having to figure out what "flavor of the week" technologies someone has implemented and research them. For this reason I've not accepted any LinkedIn offers. A college classmate suggested I revisit Rails and specifically specialize in APIs. Landed me here. Great tutorial! I especially liked the impromptu nature. (Complete with cussing.) Thanks so much!

  • @edgarcheverier
    @edgarcheverier5 жыл бұрын

    Thank you! that was really good and simple!

  • @SuperRkkk
    @SuperRkkk4 жыл бұрын

    Thanks good resource for beginers to understand REST Api

  • @pneuma1387
    @pneuma13874 жыл бұрын

    that “shit” at 4:40 was awesome

  • @SteveM2
    @SteveM27 жыл бұрын

    Nice tutorial. CRUD API in 30 mins is pretty awesome.

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    Thanks

  • @shubhashshivade6658
    @shubhashshivade66582 жыл бұрын

    Big fan sir of your teaching style

  • @tinomsakwa3757
    @tinomsakwa37577 жыл бұрын

    I have been waiting for this!!

  • @GonzaloOviedoLambert
    @GonzaloOviedoLambert4 жыл бұрын

    Thank you very much. All good, all functional and with spanish words where is applicable. Greet for Chile.

  • @viveknaik6798
    @viveknaik6798 Жыл бұрын

    Very useful video! Thanks a lot!

  • @bryansharpley4190
    @bryansharpley41906 жыл бұрын

    awesome thanks for all the great tutorials you make, if you do happen to expand on this and make one on connecting a js front end would be awesome with react or react-native

  • @joshcesana
    @joshcesana5 жыл бұрын

    Great video! It helped me out a lot!

  • @lexvieiralima
    @lexvieiralima4 жыл бұрын

    Great video brad, very useful :)

  • @Thales1250
    @Thales12506 жыл бұрын

    Thank you so much! Really helpful!

  • @Sindoku
    @Sindoku5 жыл бұрын

    Awesome thanks for posting this, Rails APIs are the easiest to make in the industry, even easier than Express IMO.

  • @davidlafontant2973
    @davidlafontant29732 жыл бұрын

    You saved my day. Thank you very much 👏🏿👏🏿👏🏿👏🏿👏🏿👏🏿👏🏿

  • @ahmetomer1759
    @ahmetomer17597 жыл бұрын

    You are an inspiration to me showing you don't have to be a nerd looking guy with glasses and mess hair to be a programmer I love it :)

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    Thanks. Yeah screw stereotypes. I can't stand them. I do have glasses by the way, my eyes are horrible but I wear contacts :)

  • @devilmanscott

    @devilmanscott

    7 жыл бұрын

    Yeah, but it's the nerd looking people who normally put the most work & time into it, computing if you really want to be good you have to sacrifice many things. Also love books & documentation, people forget there's already been over 70 years of knowledge build up and that takes a long time to catch up to, I see too many trying to do shortcuts and rely too heavily on frameworks and libraries. Frameworks came to be because people who knew how to do from scratch wished to make development quicker, but now people only know how to use frameworks without understanding the core structure itself.

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    You can still care about what you look like, dress nice, go to the gym, etc and have huge passion for programming (or anything else). I have nothing against the people you are talking about, the nerdy types that basically do nothing else but I love diversity and I love to show people that anyone can do this if you have the passion for it, doesn't matter what you dress like, look like, music you like or anything else.

  • @devilmanscott

    @devilmanscott

    7 жыл бұрын

    I wasn't saying you couldn't, I was just added the reason why a certain type of person seems to be so prevalent within the industry as I try to get really in-depth into computing knowing it from all angles from both low and high even I find it hard to allocate time for other things hence why I said sacrifice is quite often demanded, if you want to reach the zenith of your field, whether that be web, gaming, desktop, network and so on. Quite frankly the more I delve deeper into the rabbit hole it gets even more overwhelming, so I understand why people stop caring about the more normal day to day activities, luckily enough I enjoy computing immensely, but I do understand why many drop off, I now also tell people don't get into it, if you are just trying to make money, only if you truly interested. Anyway nice video.

  • @rodlu811
    @rodlu8116 жыл бұрын

    Thank you. Awesome work!!!

  • @juroltv3119
    @juroltv31192 жыл бұрын

    Thank you so much, Sir! More power

  • @Dams21
    @Dams215 жыл бұрын

    Great tutorial! Thank you :)

  • @estah0
    @estah06 жыл бұрын

    Fantastic video man!

  • @groupemana6887
    @groupemana68877 жыл бұрын

    Thanks to your videos I learned lot of things. Can you make tutorials on JEE and Symfony ?

  • @saitej8018
    @saitej80185 жыл бұрын

    Thank you very much for the great video.This helped me a lot, please make the video on the authentication of API application

  • @emmanuelo.5594
    @emmanuelo.55944 жыл бұрын

    That was awesome you're the best it's even easier than rest Api in Flask 😎😎😎

  • @ewertonfrancoo
    @ewertonfrancoo6 жыл бұрын

    Hey Dude! The video is awesome!! Thank you

  • @yasminekordjazy3378
    @yasminekordjazy33782 жыл бұрын

    awesome! clear explanations

  • @orestiarsi
    @orestiarsi6 жыл бұрын

    Really really helpful, thank you

  • @PetriikVx
    @PetriikVx6 ай бұрын

    Wonderful, thank you Brad. Six years later works well. Just one change: update_attributes is already been deprecated, use update instead.

  • @eugenemusebe4963
    @eugenemusebe49637 жыл бұрын

    Damn you rock man.Am a laravel guy and just realized shifting to rails can take me a week or so to grab the concepts

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    Yes! That is what many people that a re just starting out do not understand. They ask how I know so many frameworks, but there is just so much that is similar. If you know migrations in Laravel you know them in Rails. Just minor syntax differences. There are so many things like that

  • @miguekos1233
    @miguekos12335 жыл бұрын

    Exelente explicacion, justo lo que necesitaba.. Saludos

  • @AlexSmithCGI
    @AlexSmithCGI7 жыл бұрын

    Thanks, Can you make Video on AngularJS 2 using this Rails API

  • @ahsanihsan8203
    @ahsanihsan82035 жыл бұрын

    Dude you are a life saver. Thank you.

  • @denisgaivoronskii6907
    @denisgaivoronskii69076 жыл бұрын

    Вы спасли мою курсовую работу! Thanx a lot!

  • @Treedboxcom
    @Treedboxcom6 жыл бұрын

    Very nice, thank you! Already subscribed :)

  • @jassochivisuals5113
    @jassochivisuals51137 жыл бұрын

    Amazing video! Keep it up.

  • @raphaelmro
    @raphaelmro5 жыл бұрын

    Amazing tutorial!

  • @yli8888
    @yli88886 жыл бұрын

    Great article - thank you Traversy. One small bug in the controller destroy method. It should follow the same pattern to be safe: if article.save ... else ... end

  • @minelove789
    @minelove7896 жыл бұрын

    Thank you so much sir! Salute to you!!!

  • @mazarpradecki2983
    @mazarpradecki29835 жыл бұрын

    Great video! Thanks!

  • @JackAndAmandaGoode
    @JackAndAmandaGoode3 жыл бұрын

    Kept it real. Love it!

  • @lilSanchez100
    @lilSanchez1003 жыл бұрын

    awesome as always!

  • @shuckle2134
    @shuckle21344 жыл бұрын

    I'm really digging ruby right now: just wish it was more popular these days.

  • @user-vw9qj8el4q

    @user-vw9qj8el4q

    4 жыл бұрын

    oh yeah

  • @singleshotdiocampo3151
    @singleshotdiocampo31516 жыл бұрын

    Freaking awesome! Thank you!

  • @muhammadahmad7329
    @muhammadahmad73295 жыл бұрын

    Great Informative Video

  • @cedrio1027
    @cedrio10274 жыл бұрын

    man you helped me so much thank you

  • @005JR8
    @005JR86 жыл бұрын

    hi thanks for video can you make a video on api consumption ... from one rails appilcations to another like you did here with postman

  • @rotrose7531
    @rotrose75316 жыл бұрын

    thank you very much! It is too great!

  • @jhonnymoreira2915
    @jhonnymoreira29156 жыл бұрын

    It is valid to notice that at 18:39, the @articles could be something like: Article.order(created_at: :desc).

  • @alfredosotoz
    @alfredosotoz6 жыл бұрын

    Thanks for the video, I've learn a lot. Have on question, when doing a get request, how can you find by the title of the article and not by the ID? Sorry if my question is dumb, I'm newbie and learning. Thanks!

  • @mitdonga7149
    @mitdonga7149 Жыл бұрын

    Thank you very much

  • @priyankashahasane7758
    @priyankashahasane7758 Жыл бұрын

    Thank you 😊

  • @ssj3broly105
    @ssj3broly1056 жыл бұрын

    very easy to follow

  • @Thaidakarium
    @Thaidakarium7 жыл бұрын

    :0 this was unexpected for me x) thanks sensei

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    lol, It was unexpected to me too... I just decided to do it this morning :)

  • @omarsaulmoralesibarra117
    @omarsaulmoralesibarra1177 жыл бұрын

    Great vídeos!

  • @juancamiloq1
    @juancamiloq17 жыл бұрын

    Brad my man, Im kinda new to programing and Im already learning Rails, a lot of people told me that its the best way to learn back end. What do you think? Awesome job man, please keep keep going :)

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    I think it is a good choice. It is very clean compared to something like PHP but all languages/frameworks have pros and cons. Node.js/Python/Ruby on Rails/PHP all good choices, it is all preference.

  • @juancamiloq1

    @juancamiloq1

    7 жыл бұрын

    Thx a lot man! I´m going to keep learning Rails and later start with the JavaScript thing. I'm still very glad to see your React and other JS videos, to make me the best idea of everything that its going on.

  • @amani_art

    @amani_art

    7 жыл бұрын

    Juan Camilo Quintero best decision ever.

  • @harjitsingh7308

    @harjitsingh7308

    5 жыл бұрын

    Ruby is cool. It paves a way for other languages, after you know ruby it is easier to learn python, crystal and elixir

  • @amarpatwa6752
    @amarpatwa67527 жыл бұрын

    hey Brad , your work is fantastic . please make a video on codeigniter restful API.

  • @sushmithabhaskar3919
    @sushmithabhaskar39194 жыл бұрын

    You helped me a lot...

  • @TariqueMahmud313
    @TariqueMahmud3137 жыл бұрын

    I thought you are a very skinny and geek looking guy :) I've been wrong for years! Thanks for another great tutorial.

  • @TraversyMedia

    @TraversyMedia

    7 жыл бұрын

    I get that a lot :) Unfortunately that is how we think of programmers. I enjoy breaking stereotypes

  • @cliffhregis
    @cliffhregis4 жыл бұрын

    great tutorial!

  • @8o8inSquares
    @8o8inSquares6 жыл бұрын

    Thank you matey!

  • @monishnjs
    @monishnjs6 жыл бұрын

    nice explanation

  • @silentoldies5583
    @silentoldies55832 жыл бұрын

    If you are using a recent version or RoR and get the error `undefined method update_attributes` for the update functionality, replace the `update_attributes` with just `update`

  • @vicentemendoza4821
    @vicentemendoza48216 жыл бұрын

    well done! Excellent!

  • @crystalsky7615
    @crystalsky76157 жыл бұрын

    Thanx Brad...

  • @giridharan4771
    @giridharan47715 жыл бұрын

    Nice tutorial

  • @coffeeintocode
    @coffeeintocode7 жыл бұрын

    Hey Brad, any chance of the same thing with PHP7? Keep up the great work, I'm doing your React course right now too

  • @jagoanlangitku6571
    @jagoanlangitku65715 жыл бұрын

    great tutorial

  • @ceznvr
    @ceznvr7 жыл бұрын

    If you get "ActionController::InvalidAuthenticityToken" error you can add skip_before_filter :verify_authenticity_token to application_controller.rb to make it work

  • @makymadi242

    @makymadi242

    5 жыл бұрын

    skip_before_action :verify_authenticity_token

  • @KidCareSolution-dr3pi
    @KidCareSolution-dr3pi5 жыл бұрын

    Thanks a lot!

Келесі