O'Reilly logo

Crafting Rails 4 Applications, 2nd Edition by José Valim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Understanding the Rails Rendering Stack

Action Mailer and Action Controller have several features in common, such as template rendering, helpers, and layouts. To avoid code duplication, those shared responsibilities are centralized in Abstract Controller, which both Action Mailer and Action Controller use as their foundation. At the same time, some features are required by only one of the two libraries. Given those requirements, Abstract Controller was designed in a way that developers can cherry-pick the functionality they want. For instance, if we want an object to have basic rendering capabilities, where it simply renders a template but does not include a layout, we include the AbstractController::Rendering module in our object, leaving out ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required