I am learning Rails and I have seen these template engines. I have no experience with them (only erb).
But as I am a beginner, I am really confused. Which one do you suggest and why? Erb, Haml or Slim? Please tell your reason for preferring one over the others. And if you have any other recommendations, please let us know.
EDIT: I am NOT looking for a winner here. I just want to hear your opinions about them, their syntax, speed of execution, and so on.
ERB has a simple syntax for mixing HTML and Ruby commands, but it can be somewhat verbose. Haml is a very popular alternative which has a condensed syntax for expressing HTML.
Haml (HTML Abstraction Markup Language) is a templating system that is designed to avoid writing inline code in a web document and make the HTML cleaner.
An ERB template looks like a plain-text document interspersed with tags containing Ruby code. When evaluated, this tagged code can modify text in the template. Puppet passes data to templates via special objects and variables, which you can use in the tagged Ruby code to control the templates' output.
Two big advantages of using slim over haml:
Slim is currently about eight times faster than haml.
Slim supports HTTP streaming, while HAML doesn't.
Slim has a more natural syntax: a href="foo.html"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With