Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

template library - specific needs

0 views
Skip to first unread message

itsme213

unread,
Sep 2, 2005, 12:34:19 PM9/2/05
to
I'm looking for a template library that will allow me to define text
templates (mostly html, at least initially) with embedded Ruby calls, with
some specific needs / preferences:

- Be valid (x)html even with the embedded Ruby
- Allow selected Ruby calls in the template to return full (nested) html
structures (perhaps by that call itself dynamically using another template)

Any Suggestions? A search on RAA listed lots of candidates and I'm not sure
where to start.

Thanks.


Mikkel Bruun

unread,
Sep 2, 2005, 1:30:27 PM9/2/05
to
there are many template systems in ruby...
erb templates are kind of the defacto standard...try it

James Edward Gray II

unread,
Sep 2, 2005, 1:42:43 PM9/2/05
to
On Sep 2, 2005, at 12:31 PM, Mikkel Bruun wrote:

> there are many template systems in ruby...
> erb templates are kind of the defacto standard...try it

ERb fails the very first requirement of what the other person was
looking for. ;)

James Edward Gray II


Greg Millam

unread,
Sep 2, 2005, 2:04:03 PM9/2/05
to
On Sat, Sep 03, 2005 at 01:36:25AM +0900, itsme213 wrote:
> I'm looking for a template library that will allow me to define text
> templates (mostly html, at least initially) with embedded Ruby calls, with
> some specific needs / preferences:

erb is the accepted way to do this.

Frankly, though, I'm of the group that thinks code and templates should
not mix. (It's why I joined PageTemplate - I liked it so much, I took up
the project)

> - Be valid (x)html even with the embedded Ruby

Technically, you can *probably* do this with any templating system. How?
Just use comments.

<!--
<% ruby code here %>
-->

I still stand by my statement that code doesn't belong in templates :D.

(And for the record: you can use either the comment-style above, or
HTML::Template syntax in PageTemplate)

> - Allow selected Ruby calls in the template to return full (nested) html
> structures (perhaps by that call itself dynamically using another template)

Most systems should have an include command.

Ara.T.Howard

unread,
Sep 2, 2005, 2:09:51 PM9/2/05
to

amrita supports all of this and also separates code from template - the
templates are actually totally valid html. i've used it for years and love
it.

cheers.

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| Your life dwells amoung the causes of death
| Like a lamp standing in a strong breeze. --Nagarjuna
===============================================================================

0 new messages