antirez / antirez/nolate

Interpolating a sub-template

未關閉
#2 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Ruby
星號
40
分支
5
PR 合併指標
30 天內沒有已合併 PR

描述

test.rb
require './nolate'
$foo = [["fish",29],["chips",43],["monkey",57]]
print nlt("index.nlt")

views/index.nlt
This is a list of items
<%= $foo.each do |k| nlt("row.nlt", {:k => k}); end %>
This is after the list

views/row.nlt
\* Item: <%#k[0]%> costs <%#k[1]%>

This doesn't output what I'd expect. What am I doing wrong?

output
This is a list of items
fish29chips43monkey57
This is after the list

Additionally, if I use i as the variable in the each, it crashes with
./nolate.rb:38:in `nolate': undefined method`<' for ["monkey", 57]:Array (NoMethodError)

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。