public
Last active — forked from jonathan/huh?

  • Download Gist
huh?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<select id="item-kind" name="item[kind]" class="kind">
{{itemOptions this}}
</select>
 
 
helpers =
formItemOptions: (item) ->
_.reduce(
item.itemKinds
(out, itemKind) ->
out + '<option value="' + itemKind.value + '">' + itemKind.name + '</option>'
'<option value=""></option>'
)
 
item =
itemKinds:
[value: "one", name: "One"]
[value: "two", name: "Two"]
 
expected:
<option value=""></option><option value="one">One</option><option value="two">Two</option>
 
actual:
"
<option value=""></option><option value="text">Text Field</option><option value="textarea">Text Area</option><option value="range">Range</option>
"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.