Template Engines

erb

Recommended

haml

Haml (HTML Abstraction Markup Language) is a layer on top of HTML or XML that's designed to express the structure of documents in a non-repetitive, elegant, and easy way by using indentation rather than closing tags and allowing Ruby to be embedded with ease. It was originally envisioned as a plugin for Ruby on Rails, but it can function as a stand-alone templating engine.

haml 35,689,531 Downloads Last release

haml/haml Last commit

slim

Slim is a template language whose goal is reduce the syntax to the essential parts without becoming cryptic.

slim 12,825,520 Downloads Last release

slim-template/slim Last commit

liquid

A secure, non-evaling end user template engine with aesthetic markup.

liquid 9,082,989 Downloads Last release

Shopify/liquid Last commit

mustache

Inspired by ctemplate, Mustache is a framework-agnostic way to render logic-free views. As ctemplates says, "It emphasizes separating logic from presentation: it is impossible to embed application logic in this template language. Think of Mustache as a replacement for your views. Instead of views consisting of ERB or HAML with random helpers and arbitrary logic, your views are broken into two parts: a Ruby class and an HTML template.

mustache 9,302,396 Downloads Last release

mustache/mustache Last commit

Want to stay up-to-date with Ruby on Rails?

Join 34,885+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.