The Frontier logo The Frontier logo
08:58
Josh Justice

Rails APIs (Part 4) - Custom Actions

Josh Justice | Sep 17, 2018


How can I implement controller actions in Rails?

In past screencasts, we’ve set up a simple web service in Rails, deployed it to production, and added authentication. We let Rails generate the logic to perform create, read, update, and delete actions. That's worked well so far, but at some point we’re going to need to adjust or write our own controller code.

In this screencast...

In this screencast, we’ll follow up on our previous videos in this series and show you how to rewrite custom controller actions in Rails.

After this screencast, you'll be able to…

- Understand how controllers generated by Rails scaffolding works
- Implement your own controller actions
- Access records in the database
- Specify what data and HTTP status to return
- Understand how Rails run model validations

Prerequisites

Basic knowledge or experience building frontend applications is recommended.

Additional Resources

Rails resourceful routing
Rails controller docs
CRUD with Rails models