Wrapping Up

In this chapter we created a renderer for the PDF format. Using these ideas, you can easily create renderers for formats such as CSV and ATOM and encapsulate any logic specific to your application in a renderer, as well. You could even create a wrapper for other PDF libraries that are able to convert HTML files to PDF, such as the paid Prince XML library or the open source Flying Saucer, which is written in Java but is easily accessible through JRuby.[12][13][14]

We also discussed the Rails rendering stack and its modularity. As Rails itself relies on this well-defined stack to extend Action Controller and Action Mailer, it makes the rendering API more robust; it was battle-tested by Rails’s own features and various use cases. ...

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.