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 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…
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.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.