Chapter 4Sending Multipart Emails Using Template Handlers

  • The Rails template-handler API

  • Multipart templates with Action Mailer

  • Rails generators and railties

To finish our tour of the Rails rendering stack, let’s look at how Rails compiles and renders templates. So far, we’ve seen that a controller’s responsibility is to normalize the rendering options and send them to the view renderer. Based on these options, the view renderer asks the lookup context to search for a specific template in the available resolvers, also taking into account the locale and format values the lookup context holds.

As we saw in ​Writing the Code​, the resolver returns instances of ActionView::Template, and at the moment those instances are initialized, ...

Get Crafting Rails 4 Applications, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.