How to customize the Rails rendering stack to look up templates from the database
How Ruby Hash lookup works
How to speed up controllers with ActionController::Metal
When Rails renders a template, it has to get that template from somewhere. By default, Rails serves templates from the filesystem, but it doesn’t need to be limited like that. Rails provides hooks that allow us to retrieve templates from anywhere we want, as long as we implement the required application programming interface (API). Let’s explore this by building a mechanism that lets us serve templates from a database—templates that can be created, updated, and deleted through the web interface. But first let’s take a deeper ...