I am new to Pug and I am trying to generate a Select set of Options like this:
JavaScript
x
4
1
select
2
each variable in variables
3
option(value=variable.id) #{variable.var_name}
4
However the result I get, in the rendered page, is an empty select input followed by the list of options as text
Advertisement
Answer
Indents the code https://pugjs.org/language/iteration.html
JavaScript
1
4
1
select
2
each variable in variables
3
option(value=variable.id) #{variable.var_name}
4