# ERB or other Templating libraries/frameworks

**URL:** <https://www.ruby-forum.com/t/erb-or-other-templating-libraries-frameworks/116488>\
**Category:** Ruby\
**Created:** [October 6, 2007, 12:46am UTC](https://www.ruby-forum.com/t/erb-or-other-templating-libraries-frameworks/116488 "2007-10-06T00:46:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![venkat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4491bb/32.png) [@venkat](https://www.ruby-forum.com/u/venkat)\
**Post date:** [October 6, 2007, 12:46am UTC](https://www.ruby-forum.com/t/erb-or-other-templating-libraries-frameworks/116488/1 "2007-10-06T00:46:01Z")

</div>

Is there a tutorial for erb or any other templating classes.

Rails is the predominant framework used to write web applications. But,  
I am  
thinking of developing web applications using a templating system that  
generates HTML for majority of the website. For modules that involve  
forms  
or custom searches, I might use CGI or Rails. There are other templating  
gems like Amrita2. Is it advantageous to use Amrita2 than ERB? Is this a  
good approach to take or should I stick to Rails?

A little about the application I am trying to develop: It is a  
classified/ads with several categories in various cities. Most users  
would  
typically use the category listings page to view detail ad page. So each  
category listing page can be generated every few minutes. However, if  
the  
user searches using a query, then a custom search results page is  
written  
using Rails or CGI.

Are there any resources on the web to learn about it? Specifically, I  
am  
looking for ERB examples.

Are there any other approaches that can be used?

-Venkat

---

<div class="post-metadata">

**Author:** ![venkat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4491bb/32.png) [@venkat](https://www.ruby-forum.com/u/venkat)\
**Post date:** [October 6, 2007, 1:08am UTC](https://www.ruby-forum.com/t/erb-or-other-templating-libraries-frameworks/116488/2 "2007-10-06T01:08:51Z")

</div>

On Oct 5, 2007, at 5:45 PM, Venkat wrote:

> this a  
> written  
> using Rails or CGI.
> 
> Are there any resources on the web to learn about it?  
> Specifically, I am  
> looking for ERB examples.
> 
> Are there any other approaches that can be used?
> 
> -Venkat  
> Rails is probably the easiest approach to this. It just provides so  
> much functionality already ready to use.  
> Rails uses ERb by default.  
> Erubis is a faster Eruby, but ERb is fast enough for most things.

Building your own sophisticated CGI in Ruby can be as much pain as  
learning Rails (unless you’ve done it a bit in the past with Perl,  
then it will be old hat), so you might find your time well-spent  
learning Rails.

That said there are other web frameworks that shouldn’t be ignored:  
Merb, Camping, IOWA, etc…

---

<div class="post-metadata">

**Author:** ![venkat](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/4491bb/32.png) [@venkat](https://www.ruby-forum.com/u/venkat)\
**Post date:** [October 6, 2007, 1:10am UTC](https://www.ruby-forum.com/t/erb-or-other-templating-libraries-frameworks/116488/3 "2007-10-06T01:10:30Z")

</div>

Venkat wrote:

> Is there a tutorial for erb or any other templating classes.

The grand tutorial for ERB / eRuby / erb / embedded Ruby:

[Programming Ruby: The Pragmatic Programmer's Guide](http://www.ruby-doc.org/docs/ProgrammingRuby/html/web.html#S2)

And since your target output is HTML, take a look at HAML:

[http://haml.hamptoncatlin.com/](http://haml.hamptoncatlin.com/)

> Is it advantageous to use Amrita2 than ERB?

They follow different philosophies: Amrita2 works with _data_ whereas  
ERB works with _code_.

I personally prefer ERB because, being a programmer, I cherish the  
ability to insert arbitrary code expressions within a template. In  
fact, I was a big PHP monkey back in the day, so maybe that’s why I like  
ERB so much. 🙂
