[Rg 130] [PATCH] update the Amrita2 (2.0.0) template engine

Keita Yamaguchi keita.yamaguchi at gmail.com
Sun Jan 20 03:30:32 EST 2008


Hi,

This is a patch for updating Amrita2 template engine of Ramaze.

Amrita2 version 2.0.0 was released at 2008/01/16, it changed API and
added some features from version 1.9.x.

Example:

class MyController < Ramaze::Controller
  def index
    # @data is used as model data for rendering.
    # Almost all objects(Hash, Array, String, etc.) can be model data.
    @data = {:one => 1, :two => 2}
    # AmXML with erb
    "<<:one>> + <<:two>> = <%= $_[:one] + $_[:two] %>"
    # => "1 + 2 = 3"
  end

  def am_src
    @data = {:title = "hello"}
    # Amrita1 style using the attribute "am:src"
    "<h1 am:src='title'/>"
  end


end

Regards,
Keita Yamaguchi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update-amrita2.patch.gz
Type: application/x-gzip
Size: 3461 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20080120/b1072984/attachment.gz 


More information about the Ramaze-general mailing list