Create a Basic API with Ruby on Rails - Part 1 - Returning JSON Data
Vložit
- čas přidán 11. 02. 2021
- PART 1 - Returning JSON DATA
Welcome to a new ongoing tutorial mini-series dedicated to building an API-driven Ruby on Rails application.
The goal of this series is to give some perspective of what it's like building a backend API that can talk to multiple applications no matter the platform.
I plan to discuss topics like returning data to a client, routing, versioning, authentication, and more.
Read the full blog post here: web-crunch.com/posts/create-a...
=======
Hi, My name is Andy Leverenz and I work as a product designer and developer. For fun, I design, code, and write. Check out my blog called Web-Crunch web-crunch.com where I publish design and development tutorials with the occasional vlog.
♥️ Sponsor me on GitHub
github.com/sponsors/justalever
☕️ Keep me awake. Buy me a coffee
www.buymeacoffee.com/webcrunch
📰 One-Click Subscribe:
czcams.com/users/webcrunc...
💻 Previously published at:
web-crunch.com/posts/create-a...
👋 Latest Course: HELLO HTML & CSS (coming soon)👋
hellohtmlcss.com
💎Ruby on Rails Course: HELLO RAILS
hellorails.io
💻 Check out the blog:
web-crunch.com
🦄 Check out my personal site:
justalever.com
🚀 Links:
Weekly Newsletter: digest.web-crunch.com/
Twitter: / webcrunchblog
Github: github.com/justalever
📘Check out my book on UX Design:
"LUXD: Learn User Experience Design"
web-crunch.com/products/luxd
📙 Check out my FREE book on Tumblr Theming:
"Pro Tumblr Theming"
web-crunch.com/products/ptt
Great content, thanks for sharing Andy!
I love the theme which you are using in VS Code!
Awesome video !
Very nice. Insane you don't have more views.
thanks!
Good
Thank you for your tutorial. I wonder which extension that helps you type so fast?
I think you're looking for Emmet which autocompletes some different languages 👍
Thanks for this tutorial! Hey I have a question, after I migrate after creating the first book. I can't see anything on the localhost:3000 ? I've created an api before with localhost:3000/api/v1/ and get a response on postman but when I follow the steps I cant get anything back. What could it be?
Edit: Got it, had to reboot rails server
It looked like it was added to git without any commands... how did you set that up?
Is it possible to only show certain data in, for example, the index action of the controller and other data in the show action? I want to show more detailed info in show, but with the serializer is always the same
I resolved it. You can create custom serializations!
Awsome video. But i dont know why, bur the --api command doesn't works on may rails 6.1.7. Doens not creates any API controllers or JSON renderings, e etc.. It creates a rails full app. Dont know what to do.. anyone please?
maybe you forgot the scaffold part. Once you created the app using --api, there will be no generated api controller or json yet, unless you scaffold. you can also generate your own controller "rails g controller " then you can start your actions