In this video series we will build a Rails API from scratch. Backend APIs are useful for serving data to frontend applications, mobile apps or other backend services.
✨ Check out the new version of this video series, which has been updated for Rails 7 https://youtu.be/FJiIvFoxqsc
📖 You can also purchase the eBook and code for the new Rails 7 tutorial - https://tomkadwill.gumroad.com/l/rails-api-tutorial
This video covers:
0:00 - Introduction
0:32 - Benefits of using test driven development (TDD)
0:59 - Running the failing CREATE action spec
2:06 - Rewriting the params in separate book and author hashes
4:02 - Debugging the test failure using binding.irb
5:26 - Creating multiple records in the controller
6:41 - Merging author_id into the book params to associate the two records together
8:16 - Tidying up the book_params method
8:48 - Adding an assertion to check the Author record was created in the DB
If you’re new to this series, you may want to start with part 1: https://youtu.be/6KqbPJtA5O8