When comparing ERB vs Fortitude, the Slant community recommends ERB for most people. In the question“What are the best Ruby templating languages?” ERB is ranked 2nd while Fortitude is ranked 5th. The most important reason people chose ERB is:
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.
Ranked in these QuestionsQuestion Ranking
Pros
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.
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.
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.
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.
Pro Best Performance
It has the best performance of all of ruby templates, although it wasn't designed for productivity as HAML or SLIM.
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.
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.
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.
Cons
Con Verbose
Since ERB uses HTML syntax with Ruby logic inside it can get a little verbose like HTML files usually do.
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.
