[ANN] Amrita2 1.9.6

Amrita2 is a XML/HTML template library for Ruby. I released a new
version 1.9.6 as BETA1 for 2.0. Get it from


I reduced undocumented features and refactored much to prepare the
comming stable release. And …

  • added gemspec and make it Rails plugin
  • simplified the ERB processing feature
  • new feature for setting two attributes (like class=‘odd’ and
    class=‘even’) alternately

Now Amrita2 template can contain ERB source in it.

    <table border='1'>
      <tr id='languages'>
           <a href='<%= $_.url %>'><%= $_.name %></a>
        <td id='creator'></td>


element will be evaluated as many times as number of
’languages’ data. And each item will be set to ‘$_’ before ERB
evaluating. See this page for detail.

How to use Amrita2 with Ruby On Rails

And this method setup Template to insert two attributes alternately.

def languages_setup_template(template)
tmpl = Amrita2::TemplateText.new(template)
tmpl.element_option[:languages] = { :mv_attr=> { :class=>%w(odd even)
} }

This template produces output like this.

name author
Ruby matz
perl Larry Wall
python Guido van Rossum