Wrapping Up

In this chapter, we finished our discussion about Rails’s rendering stack by building a few template handlers. Our main template handler with the merb extension mixes Markdown with ERB, allowing it to render both HTML and plain-text parts in an email by using just one template.

At the end of the chapter, we created a generator and customized Rails to use our new template handler by default. There is much more to discover in the Generators API. Besides the methods seen in this chapter, Thor::Actions defines copy_file, inject_into_file, create_file, run, and a few more. In addition, Rails has a module called Rails::Generators::Actions that provides methods specific to Rails, such as gem, environment, route, and many others. Rails ...

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.