# ERB or other Templating libraries/frameworks

**URL:** <https://rubytalk.org/t/erb-or-other-templating-libraries-frameworks/41195>\
**Category:** ruby-talk\
**Created:** [5 October 2007 22:45 UTC](https://rubytalk.org/t/erb-or-other-templating-libraries-frameworks/41195 "2007-10-05T22:45:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkat](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@Venkat](https://rubytalk.org/u/Venkat)\
**Post date:** [5 October 2007 22:45 UTC](https://rubytalk.org/t/erb-or-other-templating-libraries-frameworks/41195/1 "2007-10-05T22:45:07Z")

</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:** ![James\_Britt](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@James\_Britt](https://rubytalk.org/u/James_Britt)\
**Post date:** [5 October 2007 23:07 UTC](https://rubytalk.org/t/erb-or-other-templating-libraries-frameworks/41195/2 "2007-10-05T23:07:41Z")

</div>

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...

> **···**
>
> On Oct 5, 2007, at 5:45 PM, Venkat wrote:
> 
> > 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:** ![Suraj\_Kurapati1](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@Suraj\_Kurapati1](https://rubytalk.org/u/Suraj_Kurapati1)\
**Post date:** [5 October 2007 23:10 UTC](https://rubytalk.org/t/erb-or-other-templating-libraries-frameworks/41195/3 "2007-10-05T23:10:31Z")

</div>

Venkat wrote:

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

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

&nbsp;&nbsp;[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:

&nbsp;&nbsp;[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. 🙂

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/\](http://www.ruby-forum.com/%5C).
