antirez / antirez/nolate

Interpolating a sub-template

Open
#2 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
40
Forks
5
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.