2008-06-25
Ruby Template "Amrita" 介绍
HTML模板 + 数据模型 = HTML输出
http://amrita.sourceforge.jp/
What is Amrita?
Amrita is a a html/xhtml template library for Ruby. It makes html documents from a template and a model data.
Example
Amrita mixes a template and model data up to a html document naturally matching the id attribute of HTML element to model data.
工作方式类似于我以前做的template( fastm, domplus)。于是就关注了一下。
http://amrita.sourceforge.jp/
What is Amrita?
Amrita is a a html/xhtml template library for Ruby. It makes html documents from a template and a model data.
Example
Amrita mixes a template and model data up to a html document naturally matching the id attribute of HTML element to model data.
template
<table border="1">
<tr><th>name</th><th>author</th></tr>
<tr id="table1">
<td id="name"><td id="author">
</tr>
</table>
data
data = {
:table1 => [
{ :name=>"Ruby", :author=>"matz" },
{ :name=>"perl", :author=>"Larry Wall" },
{ :name=>"python", :author=>"Guido van Rossum" },
]
}
template + data = output
<table>
<tr>
<th>name</th>
<th>author</th>
</tr>
<tr>
<td>Ruby</td>
<td>matz</td>
</tr>
<tr>
<td>perl</td>
.......
工作方式类似于我以前做的template( fastm, domplus)。于是就关注了一下。
发表评论
提醒: 该博客已发表在公共论坛,博客所有留言会成为论坛回贴,留言请注意遵守论坛发贴规则
- 浏览: 591953 次
- 性别:

- 来自: china

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
网上银行的安全操作设计探 ...
其实浦发的动态手机密码也是一种很好的解决方案!
-- by cdredfox -
线程同步
线程同步就是线程排队 ----------------------------- ...
-- by java9981 -
网上银行的安全操作设计探 ...
这方面经验不多, 对这方面比较感兴趣.
-- by grandboy -
网上银行的安全操作设计探 ...
lz关于动态口令(动态令牌)的理解有偏差,请参照ras.com。银行内部设计核心 ...
-- by foodoo -
2008 奥运会开幕式 色彩 ...
楼上,不是LCD,是LED
-- by swflora






评论排行榜