T
Terrence Brannon
hello, I am a perl and python programmer, but for completeness, I
would like to know which dynamic html generation systems exist in Ruby
which focus on driving HTML generation outside of the HTML itself.
In an 'invasive' system, you would see presentation logic directly in
the HTML, for example:
[% IF age < 10 %]
Hello [% name %], does your mother know you're
using her AOL account?
[% ELSIF age < 18 %]
Sorry, you're not old enough to enter
(and too dumb to lie about your age)
[% ELSE %]
Welcome [% name %].
[% END %]
whereas in a 'non-invasive' system there would only be HTML with id or
class tags
<span id="age_dialog">
<span id="under10">
Hello, does your mother know you're
using her AOL account?
</span>
<span id="under18">
Sorry, you're not old enough to enter
(and too dumb to lie about your age)
</span>
<span id="welcome">
Welcome
</span>
</span>
and then you would simply remove the parts of the HTML based on age:
$age->retain('under10') if $age < 10;
My list of non-invasive (aka push-style) templating systems is
maintained here
<http://perlmonks.org/?node_id=674225>
Thanks for your feedback,
terrence
would like to know which dynamic html generation systems exist in Ruby
which focus on driving HTML generation outside of the HTML itself.
In an 'invasive' system, you would see presentation logic directly in
the HTML, for example:
[% IF age < 10 %]
Hello [% name %], does your mother know you're
using her AOL account?
[% ELSIF age < 18 %]
Sorry, you're not old enough to enter
(and too dumb to lie about your age)
[% ELSE %]
Welcome [% name %].
[% END %]
whereas in a 'non-invasive' system there would only be HTML with id or
class tags
<span id="age_dialog">
<span id="under10">
Hello, does your mother know you're
using her AOL account?
</span>
<span id="under18">
Sorry, you're not old enough to enter
(and too dumb to lie about your age)
</span>
<span id="welcome">
Welcome
</span>
</span>
and then you would simply remove the parts of the HTML based on age:
$age->retain('under10') if $age < 10;
My list of non-invasive (aka push-style) templating systems is
maintained here
<http://perlmonks.org/?node_id=674225>
Thanks for your feedback,
terrence