ActionController Modules in Rails

March 8, 2024

Track your progress

Sign in to track your progress and access subscription-only lessons.

Log In

Your Teacher

Hi, I'm Chris. I'm the creator of GoRails, Hatchbox.io and Jumpstart. I spend my time creating tutorials and tools to help Ruby on Rails developers build apps better and faster.

About This Episode

Ever wondered how Rails controllers get their functionality? Let's see how we can add translation support to Rails API controllers by looking at the Rails source

Notes

Rails defines controller functionality in modules. ActionController::Base includes all the default modules while ActionController::API provides a slimmed down version suitable for APIs. In some cases, you may need extra features in your API controllers which means heading to the API docs and Rails source code to find out how it works.

This is a great way to check out the Rails source code and see how it works internally to come up with our solution.

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.