Introducing
The Slant team built an AI & it’s awesome
Find the best product instantly
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now
4.7 star rating
0
Development
Frontend Development
What are the best Ruby templating languages?
5
Options
Considered
51
User
Recs.
Dec 5, 2021
Last
Updated
Related Questions
Activity
Have feedback or ideas?
Join our community
on Discord
Ad
5
Options
Considered
Best Ruby templating languages
Price
License
Written in
44
Slim
-
GPL 2
PHP
--
ERB
-
-
-
--
Haml
-
-
-
--
Liquid
-
-
-
--
Fortitude
-
-
-
See Full List
44
Slim
My Rec
ommendation
for
Slim
My Recommendation for
Slim
All
9
Pros
7
Cons
1
Specs
Top
Pro
•••
Clean, concise and readable syntax
The Slim syntax does not require many special symbols that make it hard to read. Instead it's very clean and readable even for people who have not worked with it before.
See More
Top
Con
•••
Very different from HTML syntax
Slim's use of indentation in it's syntax and the fact that it doesn't use any HTML tags can make it seem a little strange to designers not used to this kind of syntax.
See More
Specs
License:
GPL 2
Written in:
PHP
Top
Pro
•••
Great project health
Slim is actively developed, with new features and bug fixes being released on a regular basis. Issues are addressed quickly, and Slim continues to increase in popularity.
See More
Top
Pro
•••
Well organized and thorough documentation
Slim's documentation is well organized and detailed, every concept is thoroughly explained and it is very helpful for both advanced users and beginners.
See More
Top
Pro
•••
Faster than HAML
There are a couple of articles that talk about rendering benchmark and slim still isn't faster than ERB but it performs better than HAML.
See More
Top
Pro
•••
Flexible syntax
Slim allows the developer some control over how the syntax is written. It can be written without closing tags, instead using indentation. Or it can be written with closing tags, like standard HTML.
See More
Top
Pro
•••
Supports HTTP streaming
HTTP Streaming is a technique that keeps a connection between the web server and the web client constantly open. When the server has new information, it's immediately pushed to the client. This technique is used to considerably increase loading times, because using HTTP Streaming the web app can start rendering parts of the view that do not require any complicated calculations (for example CSS files) immediately. But to use HTTP Streaming in a Ruby app you need a template engine that supports it, fortunately Slim fully supports HTTP Streaming.
See More
Top
Pro
•••
Open source
The Slim Framework is open source and is released under the MIT public license.
See More
Hide
See All
Get it
here
Recommend
21
6
--
ERB
My Rec
ommendation
for
ERB
My Recommendation for
ERB
All
6
Pros
5
Cons
1
Top
Pro
•••
Comes with Ruby
Since ERB is included with Ruby out of the box, there is no additional installation and setup required. The fact that it's included by default in Ruby, a lot of projects use it.
See More
Top
Con
•••
Verbose
Since ERB uses HTML syntax with Ruby logic inside it can get a little verbose like HTML files usually do.
See More
Top
Pro
•••
HTML with embedded Ruby
ERB is a way to embed Ruby into plain HTML, which means there is no need to learn a new syntax for HTML. This makes ERB fast to learn, and a great option to use on projects that have multiple developers/designers.
See More
Top
Pro
•••
Familiar even for developers with no Ruby experience
ERB's interpolated tags are very familiar to developers who have worked with PHP, ASP or JSP, even though they may not have any prior experience with Ruby.
See More
Top
Pro
•••
Maintained by Ruby on Rails developers
Due to Ruby on Rails (RoR) use of ERB, the developers of RoR will continue to maintain ERB, guaranteeing project health.
See More
Top
Pro
•••
Best Performance
It has the best performance of all of ruby templates, although it wasn't designed for productivity as HAML or SLIM.
See More
Hide
See All
Recommend
9
1
--
Haml
My Rec
ommendation
for
Haml
My Recommendation for
Haml
All
5
Pros
3
Cons
2
Top
Pro
•••
Easy to learn
There are plenty of learning resources available for those who want to learn Haml. The documentation is detailed and well organized, and Haml is easy to pick up.
See More
Top
Con
•••
Bad Performance
The rendering time with haml is slower than its competitors.
See More
Top
Pro
•••
Efficient
By using indentation rather than closing tags and eliminating curly braces, Haml is fast to code. For example This: <div id ="lower"> <div class="right column"> <div id="currentDate"><%= print_date %></div> </div> </div> Can be written as: %div#lower %div.right.column %div#currentDate= print_date
See More
Top
Con
•••
Whitespace sensitivity can be problematic
Haml uses indentation to define structure, rather than closing tags. Though this, in most cases, makes code more efficient to write, it can also cause problems. Being off by one space can cause an error or change the structure of the code.
See More
Top
Pro
•••
Clean syntax
Haml's syntax is very clean and pleasant to look at. It doesn't use HTML tags and it's not verbose at all. The templates are easily readable.
See More
Hide
See All
Get it
here
Recommend
6
3
--
Liquid
My Rec
ommendation
for
Liquid
My Recommendation for
Liquid
All
3
Pros
2
Cons
1
Top
Pro
•••
Clear distinction between presentation and application
Liquid allows developers to create a clear distinction between the presentation and application layer.
See More
Top
Con
•••
Boolean algebra has some issues
Liquid has some known issues with boolean algebra when it comes to some advanced expressions. Liquid::Template.parse("{% if false and false or true %} foo {% endif %}").render # => "" false and false or true # => true It seems that Liquid simply parses from left to right, and if it finds a false and X it immediately returns false.
See More
Top
Pro
•••
Secure
Liquid templates are secure out of the box. They can be used for applications where users can edit the appearance without allowing them to run any server-side code. Liquid does just that without any needed configuration.
See More
Hide
See All
Get it
here
Recommend
3
1
--
Fortitude
My Rec
ommendation
for
Fortitude
My Recommendation for
Fortitude
All
4
Pros
3
Cons
1
Top
Pro
•••
Encourages clean design through SRP
One development pattern used frequently is to create a "high-level" widget rendering a group of HTML tags, attribute values, and content to support a single use case, then decomposing that into domain-relevant smaller widgets ("nav bar", "user menu", etc), which in turn would be decomposed into smaller widgets, This eventually leaves you with a set of "leaf node" classes encapsulating a single tag with specific attributes and content rules; "helper" widget classes that encapsulate commonly-used configurations of the leaf widgets, with possibly multiple widgets increasing in scope up to an entire page-level widget. This also encourages the use of composition over inheritance; while each widget class must subclass a Fortitude (or Fortitude-derived) base class, the use of inheritance in your own widgets will tend to be quite rare. Typically, this will shout at the maintainer, "I'm a variation on Widget X", resulting in widgets that are by and large loosely coupled and highly cohesive.
See More
Top
Con
•••
Still young
Fortitude is still a relatively young project. Being still in beta release it hasn't been documented fully and may still have bugs even though it's tested extensively.
See More
Top
Pro
•••
Encourages business-domain-fluent class usage
Fortitude widgets can either encapsulate a single HTML tag, appropriate (and validated) values for attributes, and content, or they can compose multiple such widgets as a single, domain-language-friendly unit; for example, "navigation menu", which might involve a container div, a list, and list items confirming to various formats (for actions, separators, etc). This is textbook use of the interface-segregation principle.
See More
Top
Pro
•••
No paradigm shift between views and any other part of your app
Fortitude implements "widgets"; Ruby objects that encapsulate one or more HTML tags, with additional support for the view/app as a whole. By virtue of being Ruby classes, these widgets can use all the techniques used in any other Ruby objects in your app (composition, inheritance, etc), making it easy to develop working code rapidly.
See More
Hide
See All
Get it
here
Recommend
1
Don't see your favorite option? Add it.
Built By the Slant team
Find the best product instantly.
4.7 star rating
Add to Chrome
Add to Edge
Add to Firefox
Add to Opera
Add to Brave
Add to Safari
Try it now - it's free
One sec!
Are you sure that you want to abandon your hard work?
Delete Work
Continue working
{}
undefined
url next
price drop