[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ERB or other Templating libraries/frameworks

Venkat

10/5/2007 10:41:00 PM

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


2 Answers

John Joyce

10/5/2007 11:08:00 PM

0


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

Suraj Kurapati

10/5/2007 11:11:00 PM

0

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

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

http://www.ruby-doc.org/docs/ProgrammingRuby/html/w...

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

http://haml.hamptonc...

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